On Oct 28, 2006, at 10:22 AM, Juan Lupióî wrote: > On 10/28/06, Simen Edvardsen <toalett / gmail.com> wrote: >> Continuations represent "the rest of the computation". Try googling >> continuations and continuation passing style. Here's an example of >> how >> closures and continuations are useful, cooperative threading: > > This example reminded me of Modula-2's coroutines. Are these > concepts related somehow? Since continuations represent the state of the computation including the call stack, they can be used to implement coroutines. Methods can suspend computation and pass control around to other methods; when the continuation is called, computation will resume at the same point.