Because of an article in IBM Developer Works about CPS (continuation passing style), I'm trying to not use "return".
without CPS
function getter() {
* calculate a*
return a;
}
function test() {
*part 1*
if(*condition*) {
a = getter();
}
*use a*
*part 2*
}
transition
the rest of the function
}
*use a*
*part 2*
with CPS
function getter() {
* calculate a*
continuationtest(a);
}
function test() {
*part 1*
if (*condition*) {
getter();
}
function continuationtest(a) {
}
*use a*
*part 2*
}
the problem
A loop ends in the rest of the function.
What is the solution?