Could someone explain how the 'call/cc in javascript' from the article is supposed to be used?
function callcc (f,cc) {
f(function(x,k) { cc(x) },cc);
} function callcc (f,cc) {
f(function(x,k) { cc(x) },cc);
}That's the implementation of call/cc.
For how to use call/cc, I recommend my other article on continuations:
http://matt.might.net/articles/programming-with-continuation...
If you posted a simple example of JavaScript written in continuation-passing style and using this call/cc implementation probably everything would be clear.