Pinky Promises

My implementation of the concept of a JavaScript Promise in Snap!

Interesting. I'm confused, though: NEW PINKY PROMISE immediately launches the promise. I thought the idea of a promise is that it doesn't run until someone asks for the result. (At least that's what it means in Scheme.) Am I confused?

JavaScript promises are different from Scheme promises.


See the second yellow note on the webpage linked above.

Ah, okay. That's really confusing, since it's clear that many aspects of JS were inspired by Scheme.

(Scheme promises are implemented in the "Streams (lazy lists)" library.)

For example, [mediaElement].play() returns a Promise.

I have finished creating the reporter that converts a JS Promise to a Pinky Promise.