3 ms·
ES6 generators are (shallow) coroutines This is the first I've heard ES6 generators being coroutines. Is this documented somewhere other than the PEP?
by ynniv 13y ago
ES6 generators are (shallow) coroutines
This is the first I've heard ES6 generators being coroutines. Is this documented somewhere other than the PEP?
- masklinn 13y agoI'm not sure what you're looking for exactly. The generators proposal defines the `send` method[0] (as well as `throw`) and its semantics. They're not "full" coroutines as they can't yield to an arbitrary coroutine (unless a trampoline is used), only to their parent/caller. [0] http://wiki.ecmascript.org/doku.php?id=harmony:generators#methodnext http://wiki.ecmascript.org/doku.php?id=harmony:generators#me...