Refutable pattern
Brendan Eich
brendan at mozilla.com
Tue Feb 5 23:01:09 PST 2013
Brendan Eich wrote:
> 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.
Forgot to add the one Andreas cited:
* Easier to see prefix-? in front of long object or array pattern.
/be
>
> 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
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
More information about the es-discuss
mailing list