-
Notifications
You must be signed in to change notification settings - Fork 224
Open
Labels
featureProposed language feature that solves one or more problemsProposed language feature that solves one or more problems
Description
At the moment Dart has ternary operator that requires "else" part.
In the cases when I need something like this
var s1 = 3;
s1 = s1 > 3 ? 100500 : s1
": s1" is redunant.
Or I should use "if"
var s1 = 3;
if(s1 > 3){
s1 = 100500;
}
I think It will be useful to have another one aproach to do this, something like this:
var s1 = 3;
s1 ?= s1 > 3 : 100500;
var s2 = 3;
s2 ?= s2 > 3 : 100500 + 56 * 78;
If the condition is false than all expression ignors. And the old value will not change.
This is something like collection "if" but witout collection.
gogreen42, vsevolod07c2, simc, spkersten, vycius and 1 morenatebosch
Metadata
Metadata
Assignees
Labels
featureProposed language feature that solves one or more problemsProposed language feature that solves one or more problems