[racket] begin and let/cc

From: Jos Koot (jos.koot at telefonica.net)
Date: Fri Oct 14 16:24:43 EDT 2011

(begin (let/cc out (set! k out)) 5) is (in this case) the same as:
(let/cc out (set! k out))
5
In many cases the forms within a begin-form are spliced into their contexts
(in your case spliced into the top level)
The forms of (let ( ) form ...) are not spliced into their context.
Splicing subforms in their context gives other continuations than without
splicing.
Hope this helps.
Jos

  _____  

From: users-bounces at racket-lang.org [mailto:users-bounces at racket-lang.org]
On Behalf Of nicolas.oury at gmail.com
Sent: viernes, 14 de octubre de 2011 21:40
To: users at racket-lang.org
Subject: [racket] begin and let/cc


Dear all,

I don't understand this behaviour:

> (define k #f)
> (begin (let/cc out (set! k out)) 5)
5
> (k #f)
#f
> (let () (let/cc out (set! k out)) 5)
5
> (k #f)
5


Does begin something special regarding continuation?


Best regards,

Nicolas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111014/c3abca93/attachment.html>

Posted on the users mailing list.