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] Support varargs parameters in action signatures #1

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

Comments

@srodriguez
Copy link
Member

At the moments one can not declare varargs parameters in the signature of actions (used in capacity, agents,etc)
We should be able to declare
def myAction(String... params)
Instead of
def myAction(String[] params)

@gallandarakhneorg
Copy link
Member

According to the current syntax, the varargs may be written as:

def myAction(params : String...)
def myAction(arg1 : boolean, arg2 : int...)

@srodriguez
Copy link
Member Author

What do you think about using "*" instead of "...":

def myAction(params : String* )
def myAction(arg1 : boolean, arg2 : int* )

@gallandarakhneorg
Copy link
Member

I prefer "...", but "*" seems to be a good option too.
I think that we should not support the twos for avoiding complexity in the language.

So, we are pat on this decision node. @ngaud should give his oppinion :-)

@ngaud
Copy link
Member

ngaud commented May 21, 2014

Since Scala remains one of our main inspiration in terms of Syntax let's use the scala syntax with * to stay coherent.

@gallandarakhneorg gallandarakhneorg changed the title Support varargs parameters in action signatures [lang][grammar] Support varargs parameters in action signatures Sep 4, 2014
ngaud pushed a commit that referenced this issue Jul 7, 2016
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