What’s the difference between a continuation and a callback?

I believe that continuations are a special case of callbacks. A function may callback any number of functions, any number of times. For example: var array = [1, 2, 3]; forEach(array, function (element, array, index) { array[index] = 2 * element; }); console.log(array); function forEach(array, callback) { var length = array.length; for (var i = … Read more

How could the new async feature in c# 5.0 be implemented with call/cc?

Original answer: Your question, as I understand it, is “what if instead of implementing “await” specifically for task-based asynchrony, rather, the more general control flow operation of call-with-current-continuation had been implemented?” Well, first of all let’s think about what “await” does. “await” takes an expression of type Task<T>, obtains an awaiter, and calls the awaiter … Read more