[plt-scheme] escape continuations and mred callback
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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20061006/4490c97b/attachment.html>