Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lang][grammar] Improve type declaration. (variables vs action return) #4

Closed
srodriguez opened this issue Feb 6, 2014 · 4 comments
Closed
Assignees
Milestone

Comments

@srodriguez
Copy link
Member

A variable is declared as

var String s = "xx"

while an action return type is declared with:

def myString : String {
 "xx"
}

This should be unified.

@gallandarakhneorg
Copy link
Member

I prefer the "name : type = value" syntax because it is close to the UML syntax.

@srodriguez
Copy link
Member Author

Following our exchange, we will use a scala inspired declaration:

var name : String = "my agent"
val name : String = "my agent"

def something(string : String) : String {
//...
}

@srodriguez srodriguez added this to the 0.1.0 milestone Feb 13, 2014
@srodriguez srodriguez self-assigned this Feb 13, 2014
@gallandarakhneorg
Copy link
Member

Approved.

1 similar comment
@ngaud
Copy link
Member

ngaud commented Feb 13, 2014

Approved.

srodriguez added a commit to sarl/sarl-demos that referenced this issue Feb 14, 2014
srodriguez added a commit that referenced this issue Feb 18, 2014
Constructor syntax now matches #4.
@gallandarakhneorg gallandarakhneorg changed the title Improve type declaration. (variables vs action return) [lang][grammar] Improve type declaration. (variables vs action return) Sep 4, 2014
gallandarakhneorg added a commit that referenced this issue Jun 21, 2016
Signed-off-by: Stéphane Galland <galland@arakhne.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants