-
Notifications
You must be signed in to change notification settings - Fork 226
Open
Labels
featureProposed language feature that solves one or more problemsProposed language feature that solves one or more problems
Description
The pattern-matching syntax introduces the constructs :var foo
and :foo
to declare a variable whose name matches a field on the object being matched. The purpose of this is to reduce duplication, to users don't have to explicitly write foo: var foo
.
I propose using this syntax as a way to reduce duplication when passing named arguments (or constructing records). Specifically, make foo(:argument)
equivalent to foo(argument: argument)
. Similarly, record literals could be declared using (:field)
instead of (field: field)
. This would help reduce duplication and ease acclimation to Dart for users coming from JS, which supports similar behavior when using maps as named arguments (in JS, foo({argument})
is equivalent to foo({argument: argument})
).
srawlins, TimWhiting, rrousselGit, mnordine, samandmoore and 16 moresrawlins
Metadata
Metadata
Assignees
Labels
featureProposed language feature that solves one or more problemsProposed language feature that solves one or more problems