ES6,ES7,ES8 and beyond. A Proposed Roadmap.
derhoermi at gmx.net
Sun Apr 21 07:24:09 PDT 2013
* Sam Tobin-Hochstadt wrote:
>On Sun, Apr 21, 2013 at 9:20 AM, Bjoern Hoehrmann <derhoermi at gmx.net> wrote:
>> * Sam Tobin-Hochstadt wrote:
>>>I don't see what the point of `await` is in your gist. It looks like
>>>all of the work is being done by `function^`, which looks to be sugar
>>>for creating a function and passing it to a scheduler like `Q.async`
>>>or `taskjs.spawn`. We could add that sugar if we wanted, and not need
>>>to add `await`.
>> The only language construct that allows yielding control until resumed
>> later so far is `yield`, but using `yield` to `wait` is rather awkward.
>First, using `yield` is precisely correct in the cooperative
>that we should add a new keyword with the same semantics just because
>the word choice might be awkward in English?
A function yielding a value to the caller with the option for the caller
to resume the function later is very different from a function asking to
be resumed once something has happened or has become available. I would
certainly want to express the distinction in the clearest way possible,
and there is nothing unusual about that, there are many other languages
that allow to express this distinction. I would not define the two names
so that you can always replace one by the other, though.
Björn Höhrmann · mailto:bjoern at hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
More information about the es-discuss