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

Optional positional parameters #4288

Closed
gbracha opened this issue Jul 31, 2012 · 3 comments
Closed

Optional positional parameters #4288

gbracha opened this issue Jul 31, 2012 · 3 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug
Milestone

Comments

@gbracha
Copy link
Contributor

gbracha commented Jul 31, 2012

The 0.11 spec allows for optional positional parameters, and cleanly separates named parameters from positionals.

@gbracha
Copy link
Contributor Author

gbracha commented Jul 31, 2012

Analyzer issue #4289.
VM issue #4290.
dart2js issue #4291.

@gbracha
Copy link
Contributor Author

gbracha commented Aug 22, 2012

We need to do this in stages.

(1) The first step would be to support the new syntax for named parameters, using {..}. Thus there would temporarily be two ways to specify named parameters.

(2) Then, the libraries could convert to use the new syntax.

(3) After that, the old [..] syntax would be repurposed to support optional positional parameters.

It may be worth breaking the task down into these parts.

@gbracha
Copy link
Contributor Author

gbracha commented Aug 24, 2012

An alternative approach to managing the transition is to implement the complete syntax for both named and optional parameters, but have flag that controls the interpretation. Under the transitional setting, [...] and {..} are interpreted identically under the current rules. This means that callers can still pass positional arguments to named formals. Under this setting, programmers can revise their libraries to use the new named parameter syntax wi/o breaking their callers. Or they can decide that the preferred calling convention should be positional, and retain the [...] syntax. They can fix the callers as best as they can, and then switch the flag off and detect any remaining violations.

@gbracha gbracha added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Aug 24, 2012
@gbracha gbracha self-assigned this Aug 24, 2012
@gbracha gbracha added this to the M1 milestone Aug 24, 2012
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants