And to add why auto-unwrapping is the right thing to do when using
promises-for-control:

I think of promise/resolve as the async analog to function call/return.

In sequential programming, imagine a function f() that calls another
function g() and returns its result (i.e. the call to g() is a tail-call).
The callers of f() need not know or care that f used a nested call/return
to provide its result.

In async programming, imagine a function f() that asynchronously calls
another function g() and returns its promise-result. The async callers of
f(), who immediately receive a promise for f's result, need not know or
care that f used a nested async call/return to provide that result. Any
.then callback registered on f's promise wants to see the value returned by
g, not a promise.

When using promises-as-data, auto-unwrapping becomes the wrong thing to do.
Hence the clash in semantics. I hope that is a good summary of the debate.

Cheers,
Tom
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to