On 14.04.2011 22:00, Brendan Eich wrote:
On Apr 14, 2011, at 7:43 PM, Asen Bozhilov wrote:
It will solve the problem with the ambiguous syntax.
There is no ambiguity problem with ? followed by . and then (with whitespace
allowed, of course) an IdentifierName. We need the lookahead to an
identifier-name starting-character to avoid this:
var tolerance = big ?.1:.01;
Damn, it's a mind-bender :D Really hard to get what's going on in this
expression. It's a good for quiz; thanks for the example.
More human-view version (for interested): var tolerance = big ? 0.1 : 0.01;
So we can't simply maximum-munch '?.'. But ?. is doable with some care, and
probably better spelling than -> (which does not connote the conditionality as
? does).
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss