Slight correction: bring in line with "for in" and "for of" only - since the condition part of the "for" does not allow this currently.
On 29 November 2013 16:29, Nick Krempel <[email protected]> wrote: > Couldn't find anything on this in the archives, but is there a proposal > for: > > if (let var = expr) { > // var in scope > } > else { > // var in scope > } > // var out of scope > > i.e. shorthand for: > > { > let var = expr; > if (var) { > // ... > } > else { > // ... > } > } > > Also: > > switch (let var = expr) { > case foo: > // var in scope > default: > // var in scope > } > // var out of scope > > ...which has a similar expansion. > > Similarly for "while" and "do...while": this would bring everything in > line with the current "for" / "for in" / "for of". > > This also matches what C++ allows, with the exception of "do...while" (in > our case, it seems acceptable to allow "do...while" too - the value would > simply be "undefined" on the first iteration). > > ("const" should also be OK in place of "let", at least for "if" and > "switch".) > > Nick > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

