Ian Bicking: the old part of his blog


While I like to think of continuations concretely (I started with machine language and graduated to assemblers and compilers), the mind-bendingly tricky part of a continuation is that it can be used more than once. If you remove that ability, what you have is essentially co-routines, a much simpler concept.

With true continuations, you can enter a function E times and leave it X times with just about any values for E and X (except that E must be greater than 0 to form the continuation).

In a functional language this is a bit easier to think about. We are (or at least I am) pretty well trained to be surprised by a function which returns several times. I can kind of understand "what the effect of this continuation is,"
for some functional continuations. The shift to the more concrete is a bit more exciting in imperative languages; perhaps a setable hardware interrrupt dispatch vector is my best mental model in the imperative world: There you have the continuation when the hardware blinked (that you usually resume) and the continuation which is the "what to do on a hardware blink."
Comment on Continuations: a concrete approach
by Scott David Daniels