Refutable pattern

Brendan Eich brendan at mozilla.com
Tue Feb 5 23:00:29 PST 2013


Sorry if I was a thread-killer, posting four times in a row.

On balance we have:

prefix-? pros:
* LR(1) grammar without ambiguity or lookahead restriction.

prefix-? cons:
* ASI hazard if ? starts an intended destructuring assignment expression.

suffix-? pros:
* Matches CoffeeScript
* Matches o?.p existential operator 
(http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator).

suffix-? cons:
* Requires yet another a lookahead restriction on top of LR(1).

I'm ok either way. I made my best case for suffix-?. Thoughts and 
comments welcome.

/be


More information about the es-discuss mailing list