Generator Arrow Functions
gorgi.kosev at gmail.com
Fri Nov 15 02:11:50 PST 2013
On Thu 14 Nov 2013 11:16:22 PM CET, Brendan Eich wrote:
> Claus Reinke wrote:
>> What I don't understand is why generator expressions are not used
>> as the only way to create generators, leaving 'function' alone.
> We have been over this before: to support flows that for-of loops
> cannot expression, specifically coroutine libraries such as
The suggested topics seem to be ignoring that use case (using the result
of the yield expression) and only considering the iterator case. The
() => (for (y of gen) y)
isn't going to work for generators that need the values of the yield
expression (like in task.js), right?
spawn(() *=> yield (yield
From what I've seen, async generators are so popular (at least in
node-land) that people are building entire frameworks and library
ecosystems based on them even though they're only available behind a
flag, in an unstable version of node. Even more, a dedicated transpiler
was written to support transpiling *just* generators, with the async
use case in mind.
Right now from where I stand, its almost as if the other use case of
generators (as iterators) is completely unimportant.
So I really don't see how there isn't a strong enough case for generator
More information about the es-discuss