Mark Volkmann (2014-03-30T13:06:18.000Z)
I looked at the "async" keyword examples in Traceur for the first time
today. Cool stuff!

IIUC, when a function is annotated with the async keyword, it can use
"await" and the "done" function is magically defined.

An interesting corollary to that idea would be to introduce a "promise"
keyword that can be used to annotate a function. It would magically define
the functions "resolve" and "reject". It would allow a function like this:

function foo() {
  return new Promise((resolve, reject) => {
    // some code that eventually calls resolve or reject
  });
}

to be written like this:

promise function foo() {
  // some code that eventually calls resolve or reject
}

Is this a crazy idea? Perhaps if this was available, it would be very rare
to actually write "new Promise(" in code.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140330/7bec7fb5/attachment.html>
domenic at domenicdenicola.com (2014-04-11T22:40:23.748Z)
I looked at the "async" keyword examples in Traceur for the first time
today. Cool stuff!

IIUC, when a function is annotated with the async keyword, it can use
"await" and the "done" function is magically defined.

An interesting corollary to that idea would be to introduce a "promise"
keyword that can be used to annotate a function. It would magically define
the functions "resolve" and "reject". It would allow a function like this:

```js
function foo() {
  return new Promise((resolve, reject) => {
    // some code that eventually calls resolve or reject
  });
}
```

to be written like this:

```js
promise function foo() {
  // some code that eventually calls resolve or reject
}
```

Is this a crazy idea? Perhaps if this was available, it would be very rare
to actually write "new Promise(" in code.