Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



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.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: