On Tue, May 29, 2012 at 11:19 PM, Brendan Eich <bren...@mozilla.org> wrote:
> Brendan Eich wrote: > >> Would property assignments be separated by comma or semicolon? >>> >>> Eg. >>> >>> o.( a = "alpha", b = "beta" ) >>> >>> v. >>> >>> o.( a = "alpha"; b = "beta" ) >>> >> >> Heh, I didn't say. Comma might be just as good meaning "no worse than >> semicolon" in light of object literals having different-enough brackets. >> Comma looks like the comma operator, and with () around it looks like an >> argument list, OTOH. >> >> On the principle of making different semantics look different, I'd go >> with ; over , at this point. But perhaps there' s a more targeted argument >> one way or the other? >> > A targeted homage: Smalltalk's fluent style used ; so we should too, > inside () after a dot. > I appreciate this reason ;), but I like semicolon for another reason -- the parens suggest "factoring out" the "o.", as if o.(stuff1; stuff2) means the same thing as o.stuff1; o.stuff2 where stuff1 and stuff2 are not identifiers, but (to take an extreme stance) anything that can appear within an expression statement between an initial "o." and a terminal ";". Although it does not fall out of the factoring interpretation, I think it is still natural for the expression as a whole to have o as its value, since expression statements are not normally thought of as having a value. However, I think it is just too much syntax to have both this and mustache. We should choose at most one. I would prefer neither to both. > > But it's not a usability argument, just a salute to one of the eight great > programming languages. Ok, I gotta ask: Which are the other seven? > > > /be > ______________________________**_________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss> > -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss