[plt-scheme] escape continuations and mred callback

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Oct 6 19:35:13 EDT 2006

There is a built-in barrier -- a delimiter of control -- around  
callbacks. If you think about it, it's quite obvious. A callback  
doesn't return. But at the same time, all functions do return  
somewhere. Well the place that is invisible and unavailable to you is  
somewhere in the system. And right around this call site there is a  
barrier for all escapes. -- Matthias



On Oct 6, 2006, at 7:19 PM, pedro pinto wrote:

> Hi there,
>
> Shouldn't this:
>
>   (require (lib "class.ss")
>            (lib "mred.ss" "mred"))
>
>   (define (go)
>     (let/ec return
>       (let ((f (new dialog% (label "Hello"))))
>         (new button% (parent f)
>              (label "Me, Me!")
>            (callback (lambda _
>                        (send f show #f)
>                        (return "Escaping"))))
>         (send f show #t)
>         "Did not Escape")))
>
>   (go)
>
>
>
> Evaluate to "Escaping" when the user clicks the "Me,Me!" button?
>
>
>
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.