On Mar 17, 2012, at 12:31 PM, Allen Wirfs-Brock <[email protected]> wrote:
> > On Mar 17, 2012, at 9:14 AM, Russell Leggett wrote: > >> On Mar 17, 2012, at 11:39 AM, Allen Wirfs-Brock <[email protected]> >> wrote: >> >>> >>> On Mar 17, 2012, at 2:03 AM, Russell Leggett wrote: >>> >>>> ... >>>> //using : instead of <|, shorten Email.prototype to just Email >>>> let email = Email:"[email protected]"; >>> >>> Basically you are saying that : becomes an expression operator. However, >>> that creates an ambiguity (and potential backwards compatibility issues) >>> with the use of : as a statement label designator: >>> >>> Email: "[email protected]"; //already valid ES meaning Email >>> is the label of this statement. >> >> Yes, I thought about this potential ambiguity but thought it was no >> different than the potential ambiguity of block statements vs object >> liberals and therefore OK. >> >>> Email: "[email protected]"; // label >>> let email = Email: "[email protected]"; // operator >> >> Considering the statement form would be useless without assignment, I didn't >> think it would really cause confusion. > > consider the proposed do {} operator that has a lot of fans. > > We have to account for what this will mean: > > Email: (do {...break Email;...}, do { ...}); I suppose I could have a personal bias because I very rarely need to use labels, but I don't think I'm alone in that. To start with, if I were making a label, I would just put it alone on its own line. Beyond that, it's not very confusing. Am I wrong that it's not actually ambiguous? {} Is that an empty static block or an empty object literal? I never find myself confused. function Foo(){} Behaves a little differently if it's a statement vs an expression as well. I don't see why this is a grammatically or cognitively ambiguous issue. - Russ > > Allen
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

