[racket] call-with-composable-continuation and DrRacket

From: John Clements (clements at brinckerhoff.org)
Date: Thu Aug 30 17:54:22 EDT 2012

On Aug 30, 2012, at 2:48 PM, Harry Spier wrote:

> When I run this in the definitions window of DrRacket
> #lang racket
> (+ 100
>   (call-with-composable-continuation
>    (λ (k) (+ 1000 (k 1)))))
> 
> it prints
> 101
> 1201
> in the interactions window.
> Why doesn't it just print 1201 ?
> 
> Executing it in the interactions window gives the expected result of 1201.

Presumably, the continuation captured in the definitions window goes out to the module's top level, which includes the macro-inserted "print out the answer" code.

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4800 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120830/a225cfb7/attachment.p7s>

Posted on the users mailing list.