Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

node webkit

Name: Anonymous 2014-02-12 2:24

Name: Anonymous 2014-02-14 5:26

>>52
Continuations are different from callbacks, and rarely supported by languages due to the overhead they incur. Imagine you can you save a point of execution in your program, and then return to this point later. You may reinvoke the execution point many times. Each time you reinvoke it, you may pass back a different value each time.

It's like you are making a sandwich. You put the ingredients on. You put it together. You take it back to the couch and watch TV. Then you see a television commercial that shows a certain topping that you missed. But you've already started eating the sandwich. So you go back in time to when you were putting the sandwich together but this time you have that topping in mind. You continue making the sandwich again and sit and watch TV. But then another commercial has reminded you of a different topping that you forgot. So you return again to the prior point of execution with a new topping to make.

You can support execution that behaves like continuations, but it's cumbersome and uses tail calls and an emulated function call stack with a stack of linked functions. Oh and the post you are replying to, you can still have that effect if you do a tail call on the callback.

I don't like how these functions are being called 'callbacks', and also that something as fundamental as a 'callback' is being associated exclusively with something as retarded as node.jiss. This pattern is used all the time in almost all languages.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List