-
Notifications
You must be signed in to change notification settings - Fork 45
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] Default value for function parameters #2
Comments
Steph, that's a great idea. However, should capacity definition allow default values? |
Yes, I guess. We may discuss on the default parameters in Skills. |
I propose the following syntax:
The generated Java functions will be: public void myAction1(String a, int b) { CODE1 }
public void myAction1(String a) { myAction1(a, 35); }
public void myAction2(String a, int b, char c) { CODE2 }
public void myAction2(String a, char c) { myAction2(a, 35, c); } |
Let the following code with ambiguity:
The generated Java code may be: public void myAction(char a, int b, int c, char d) { }
public void myAction(char a, int b, char d) { myAction(a,b,2,d); }
public void myAction(char a, char d) { myAction(a,1,2,d); } |
…th default values (issue #2). The task is not complete, but it is a first step.
Since we are using Xtext 2.6, (issue #93), the jvm inferrer and the validator are not working any more. |
…sue #2. The hidden functions are whose corresponding to the different possibilities of function implementation according to parameters with default values.
Signed-off-by: Stéphane Galland <galland@arakhne.org>
It may be useful to specify default values for the parameters:
The text was updated successfully, but these errors were encountered: