Re:Adventures of an imperative programmer in the land of fp
by jacquesm on Friday August 27, 2010 @05:46PM
(#1640392)
> in terms of setjmp/longjmp, but with multiple, persistent stacks.
That's exactly the thing I used to help me visualize it :) Funny you came up with the exact same model.
Setjmp and longjmp are by the way probably two of the most abused calls in the C runtime package. But when you need them, you need them badly.
Since you know C, it might help to think of continuations in terms of setjmp/longjmp, but with multiple, persistent stacks. (Same with coroutines, but coroutines and continuations have a lot of overlap.)