Great idea. Generators are one of the features that still seperate coffeescript from python, in terms of productivity/elegance.
Still missing is a syntax to consume these generators, like in "for a in b" or "yield from"
Still missing is a syntax to consume these generators, like in "for a in b" or "yield from"
var generator = g1(), result = {}, send;
while(!result.done) {
result = generator.send(send);
send = yield result.value;
}I've almost got yieldfrom working...
See my longer question about this upthread.
> Update: I've created a PR [pull request] for CoffeeScript. I've also just added the yieldfrom keyword...
Maybe this update happened after your comment?