[plt-scheme] continuation question

From: Robert Nikander (nikander at nc.rr.com)
Date: Fri Mar 28 10:52:58 EDT 2008

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 ()
   (let/cc c (set! k c))
   (printf "calling continuation...\n")
   (k 'whatever)
   (printf "done.\n"))


Posted on the users mailing list.