[plt-scheme] continuation question

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Mar 28 11:09:00 EDT 2008

The top level prompts the control behavior. -- Matthias


On Mar 28, 2008, at 10:52 AM, Robert Nikander wrote:
> Hi all,
>
> I'm trying to better understand continuations.  When this code runs  
> at the top level, it does not loop, unless I use the the let  
> instead of the begin.  Why?  Is the call to "k" failing? If so, how  
> come it doesn't throw an error?
>
> (define k #f)
> ;(let ()
> (begin
>   (let/cc c (set! k c))
>   (printf "calling continuation...\n")
>   (k 'whatever)
>   (printf "done.\n"))
>
>
> thanks,
> Rob
>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.