zenparsing / es6now

ECMAScript 6 to 5 Compiler and Runtime Environment
MIT License
29 stars 2 forks source link

Translate Comprehensions #2

Closed zenparsing closed 10 years ago

zenparsing commented 10 years ago

Add support for array comprehensions and generator comprehensions.

zenparsing commented 10 years ago

Fixed in e09c8431a6a87fcdf28532777afb3b9a98f240ac

retorquere commented 9 years ago

How are they supposed to work? I'm trying to translate var array = [for (x of [0, 1, 2]) for (y of [0, 1, 2]) x + '' + y];, which works in traceur, but yields an error in es6now.

zenparsing commented 9 years ago

Ah yes - comprehensions where removed from ES6, so I removed them from es6now.

retorquere commented 9 years ago

Bummer :( So comprehensions are conclusively out of es6? That seems like a step backwards. Anyhow, nothing es6now has a say in. On Nov 19, 2014 1:57 AM, "zenparsing" notifications@github.com wrote:

Ah yes - comprehensions where removed from ES6, so I removed them from es6now.

— Reply to this email directly or view it on GitHub https://github.com/zenparsing/es6now/issues/2#issuecomment-63575140.

zenparsing commented 9 years ago

Yeah - I though so to, at first. But comprehensions might come back in a different form in ES7, and besides, the old comprehension syntax (with the "for" part out in front) was a little weird compared to Python.

retorquere commented 9 years ago

The perfect is the enemy of the good :) I wonder if ES6 is going to happen in my lifetime, never mind ES7. Thanks in any case.