[plt-scheme] Understanding continuations

From: Filipe Cabecinhas (filcab at gmail.com)
Date: Wed Jul 23 02:37:44 EDT 2008

On 23 Jul, 2008, at 07:35, Filipe Cabecinhas wrote:

> (lambda (argument)  ;; Continuation that just returns to the toplevel
>  ((lambda (other-argument)  ;; Call to plus with the result of foo
>     (+ 1 2 3 other-argument))
>   ((lambda (inner-argument)  ;; the rest of the foo function
>      inner-argument
>      13))))


Of course I should pass the argument to the rest of the foo function:
(lambda (argument)  ;; Continuation that just returns to the toplevel
   ((lambda (other-argument)  ;; Call to plus with the result of foo
      (+ 1 2 3 other-argument))
    ((lambda (inner-argument)  ;; the rest of the foo function
       inner-argument
       13)
     argument)))

   - Filipe Cabecinhas





Posted on the users mailing list.