Refutable pattern

Brendan Eich brendan at
Wed Feb 6 14:09:40 PST 2013

Oliver Hunt wrote:
> On Feb 5, 2013, at 11:00 PM, Brendan Eich<brendan at>  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.
> What's the production that takes this out of LL(1)?

Nothing -- I cited LR(1) because that's the formalism the ECMA-262 spec 
uses, validated way back in ES3, supposed to be validated again for ES6.

>> prefix-? cons:
>> * ASI hazard if ? starts an intended destructuring assignment expression.
> That's interestingly icky.

Yep :-P.

>> suffix-? pros:
>> * Matches CoffeeScript
> I don't really consider that a pro, any more than matching any other language.  This obsession with coffee script comparisons isn't useful.

Now now. An unweighted dump of pros and cons with one CoffeeScript 
reference does not make an "obsession". I don't actually think this 
matters, since we have gone *against* CoffeeScript with for-of. So, 
obsess yourself :-P.

> I think prefix ? is easier from a reading point of view, but I'm not really married to either.

Agreed, and I posted mainly to try to get to consensus. Prefix-? looks 
like it is in the lead.


More information about the es-discuss mailing list