Promise.cast and Promise.resolve

Kevin Smith zenparsing at gmail.com
Wed Jan 29 07:33:01 PST 2014


>
>
> It is, actually, more simplicity. The concept of `Promise.resolve` and
> `Promise.chain` is simpler than `Promise.cast` and `Promise.then` (i.e.:
> they represent orthogonal concepts, not "complected"). `Promise.cast` and
> `Promise.then` may be, arguably, *easier* to work with, from a user POV,
> since you don't need to make as many choices. I would argue that it would
> make more sense to write `cast` and `then` in terms of `resolve` and
> `chain`, however. But this seems to have already been decided.
>

It does make more sense, and from my point of view it's not decided.  What
is decided is the AP2 design.  That is:

1)  promises are fully parametric and,
2)  `then` recursively unwraps the *input* to its callbacks.

For the sake of coherency (aka conceptual integrity), `then` needs to be
written in terms of `chain`.  This issue needs to be resolved ASAP,
however, since promises are making their way into engines now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140129/b3221c73/attachment.html>


More information about the es-discuss mailing list