On Nov 22, 2010, at 11:19 PM, Maciej Stachowiak wrote:

>> Probably we need to take our time and not rush into a meta-programming-here 
>> syntax variant of for-in. I'll not propose anything better right now.
> 
> If the colon is less future-compatible than we like, why not:
> 
> foreach (var i in x)

All the new words are not reserved, so they could begin a function call 
expression in extant code:

hi = "there"
foreach (i in x)
  print(i)

means

hi = "there"; foreach(i in x); print(i);

today. Same if you s/foreach/iterate/ or any non-reserved identifier. Wherefore 
Allen's co-opting of enum (plus with, a decent preposition given enum but 8 
chars in two keywords hurt kittens everywhere).

Anyway, the bikeshed is secondary. We need to agree on what meta-programmable 
for-in means with the enumerate trap (specified by the wiki pages on 
harmony:proxies), how that changes with the optional iterate trap 
(strawman:iterators), and when it might matter (for all for-in loops, or only 
those in Harmony code?).

/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to