Proposing a conditional assignment (or equals) operator
bjouhier at gmail.com
Tue May 10 08:58:55 UTC 2016
A big +1.
A quick grep on our code base shows 3000+ occurrences of the x = x || y
idiom in 700+ files. This proposal would make this code more compact and
more efficient, as it avoids redundant assignments.
The x = x && y idiom is a lot less common: 150 occurrences only, and is
usually associated with questionable reuse of a polymorphic variable to
walk a chain. But it would seem logical to extend the proposal to &&=.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss