3 ms·
> lazy and better promises. A+ spec got nothing on this Better how? Does it for example support unbounded recursion without stack overflow? function f(n) {
by spion 10y ago
> lazy and better promises. A+ spec got nothing on this
Better how? Does it for example support unbounded recursion without stack overflow?
function f(n) {
if (n > 0) return Promise.resolve(n - 1).then(f)
}
Because promises do (there is no maximum n above)
Also at a quick glance I see the following:
> Be careful when cancelling a hooked Future. If the resource was acquired but not yet consumed, it will no longer be disposed
This works in Bluebird; the resource will be disposed even if the promise is cancelled.
- wrong_variable 10y agoPromises are Eagar - it means it has the advantages of Eagerness. Being Lazy has the advantages of laziness which is that if you do not clean your room, you became a hoarder and your room overflows. The point I am making is that either of these tools are not holy grail. I do not think a solution for all is going to exist, just use them when it best suits the application - I think ( Like its just my dumb opinion ) also @spion I think we are going to take this argument to our death beds :D
- sotojuan 10y agoAgreed and I probably shouldn't have said native promises are bad. I think they're okay—flutures just work better with me and how I program.