Hacker News new | ask | show | jobs
by Sheepshow 4571 days ago
Not sure I understand the semantics. I'm passed what looks like a continuation, but instead of calling it, I yield it?

What other values can I yield, and why would I want to?

Alternatively, couldn't the `next` object just be a plain continuation?

1 comments

zimbatm's link to http://wiki.ecmascript.org/doku.php?id=harmony:generators was helpful here. https://wiki.python.org/moin/Generators seems to also have some useful background on where the semantics are coming from.