2013/5/26 Brendan Eich <[email protected]> > Russell Leggett wrote: > >> I'm sorry if I have just missed it trying to keep up to date, but what >> are the compelling use cases. >> > > AsyncTable with promises as values. >
What the discussion at last week's TC39 meeting clarified for me is the following: - Promises are primarily a control-flow abstraction. - Sometimes, they are also used as a data-abstraction (i.e. as a container in their own right, wrapping an arbitrary payload). - All of the subtle problems discussed in these threads only start to arise when these two use cases of promises are being mixed, e.g. a promise-as-data-container being mistaken for a promise-as-control-abstraction. This rarely happens in application code, but may happen in generic library code. The AsyncTable is one example of such generic library code that uses both promises-as-data and promises-for-control. Personally, after 6 years of programming with futures/promises, I have almost never used promises-as-data. I use them exclusively for control. I suspect most proponents of the Q-style of using promises share that experience. Cheers, Tom
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

