+ es-discuss Realized, I didn't include the mailing list.
On Sat, Apr 9, 2011 at 10:48 AM, John Lenz <[email protected]> wrote: > As a point of interest the Closure Compiler uses labelled blocks to enable > inlining of non-trivial functions. The same can be accomplished with a "do > {} while (false); " but it is less desirable. > > sent from a mobile phone excuse the spelling ... > On Apr 9, 2011 1:33 AM, "Peter van der Zee" <[email protected]> wrote: > > Can we remove labels from the next version of the spec? > > > > Labels are only used for continue and break. I don't think I've ever had > or > > seen a need for them (which does not mean they're unused, btw). They can > be > > sugar insofar as to breaking a double loop at once. But at the same time > > they promote spaghetti coding. On top of that there's a decent impact on > the > > specification. In fact, I'm a little surprised they were not excluded > from > > strict mode. > > > > So nothing would really change for label-less `continue` and break. > > > > Switch and iterations would not get an empty label (obviously) and the > whole > > label stack could be stripped. > > > > Furthermore the grammar for continue and break would be as simple as that > > for debugger. And the label statement would disappear (which is nice > because > > at the start of a statement, if the first token is an identifier, you > need > > to parse another token before being able to determine whether you're > parsing > > a label or an expression). > > > > The completion type (8.9) would no longer need to have three parameters, > > just two. > > > > Am I missing anything? Or are there cases where labels allow you do > > something that's impossible without labels? > > > > - peter >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

