Array comprehension syntax

Brendan Eich brendan at mozilla.org
Sat Sep 22 09:21:52 PDT 2012


Perhaps the thing to do is keep to Python: for+ if? if you get my 
pidgin-EBNF.

Separate issues:

* Paren-free heads can run into trouble: 
https://mail.mozilla.org/pipermail/es-discuss/2011-September/016804.html. But 
in a comprehension, the subsequent 'for', 'if', or ']' (or ')' for a 
genexp) helps, so this may not be a problem in fact. We need to work 
through it, though.

* We don't need to worry about ECMA-357 (E4X) for-each-in too much here. 
SpiderMonkey can cope, the standard shouldn't contextually reserve 
'each' or anything.

/be


More information about the es-discuss mailing list