[plt-scheme] Continuations

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Nov 5 21:04:02 EST 2007

The word 'continuation' that you are referring to in your message has  
a 3-bullet explanation:

1. Imagine a program execution, either terminating or running forever.

  Start ----- * --------- * --------- * -------- * ------->

2. Imagine any point in the middle (+), and if your program  
terminates, it could even be the end.

  Start ----- * --------- * --------- + -------- * ------->

3. Turn the ___rest of the computation___ from this point to the end  
into a procedure.

  (lambda (intermediate-result-if-any) ... instructions to perform  
the rest of the computation ...)

That procedure is the continuation and it is handed to your program.
And that's all there is to it.
And yes, Scheme is the programming language that is powerful enough  
to do this.
SML/NJ can do it too, and it does it in one instruction.
And the concept is useful but not critical to FP.

-- Matthias


On Nov 5, 2007, at 8:00 PM, Joseph Anthony Pasquale Holsten wrote:

> Okay, with the closure discussion wrapping up, what is a  
> continuation? I get closures as in
> (define (f x) (lambda (y) (* x y)))
>
> but is that a continuation too? Is a closure necessarily a  
> continuation, or vise versa, or are they mutually exclusive?
>
> Joseph Holsten
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.