Generator Arrow Functions

Kevin Smith zenparsing at gmail.com
Sat Nov 16 06:56:32 PST 2013


Heck, why not just add async functions to the agenda?

There's:

- Promises, yay
- A well-establish use-case, which is awkward to implement without (as the
original post demonstrates)
- Strong syntactic precedent with C#
- Strong semantic cowpath with TaskJS
- Strong developer interest
- A year to work out any kinks : )

By "async function", I mean something like:

async function F(p1, p2, ...pN) {
   await G();
}

which would de-sugar to something like:

function F(...args) {
    return Task.spawn(function(p1, p2, ...pN) {
      (yield G());
    }.bind(this, ...args));
}

With a [NoNewLine] after the "async" contextual keyword, obviously.

Low-risk, high-reward?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131116/9a72a395/attachment.html>


More information about the es-discuss mailing list