[plt-scheme] escape continuations and mred callback

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

Every function is called from some place, right? So think of your  
callback function. It must be called from some place. That is also  
the place where it returns to. QUESTION: Where is that?

-- Matthias



On Oct 6, 2006, at 8:06 PM, pedro pinto wrote:

> I am sorry, this continuation stuff makes my head spin. I  
> understand the barrier idea but I don't understand the motivation.  
> A callback is just another function, why is it barred from escaping?
> -pp
>
>
> On 10/6/06, Matthias Felleisen <matthias at ccs.neu.edu> wrote: 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
>
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.