I understand the callback is called from somewhere in the bowels of the MrEd code, after a GUI event has been extracted from the UI message queue. I also can imagine that escaping from the callback will prevent some resource cleanup, but I interpreted your original email as hinting at something fundamentally wrong with escaping from *any* callback. Maybe I misunderstood?
<br><br>-pp<br><br><br><div><span class="gmail_quote">On 10/6/06, <b class="gmail_sendername">Matthias Felleisen</b> <<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Every function is called from some place, right? So think of your<br>callback function. It must be called from some place. That is also<br>the place where it returns to. QUESTION: Where is that?<br><br>-- Matthias<br><br>
<br><br>On Oct 6, 2006, at 8:06 PM, pedro pinto wrote:<br><br>> I am sorry, this continuation stuff makes my head spin. I<br>> understand the barrier idea but I don't understand the motivation.<br>> A callback is just another function, why is it barred from escaping?
<br>> -pp<br>><br>><br>> On 10/6/06, Matthias Felleisen <<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote: There<br>> is a built-in barrier -- a delimiter of control -- around<br>
> callbacks. If you think about it, it's quite obvious. A callback<br>> doesn't return. But at the same time, all functions do return<br>> somewhere. Well the place that is invisible and unavailable to you is<br>
> somewhere in the system. And right around this call site there is a<br>> barrier for all escapes. -- Matthias<br>><br>><br>><br>> On Oct 6, 2006, at 7:19 PM, pedro pinto wrote:<br>><br>> > Hi there,
<br>> ><br>> > Shouldn't this:<br>> ><br>> > (require (lib "class.ss")<br>> > (lib "mred.ss" "mred"))<br>> ><br>> > (define (go)<br>> > (let/ec return
<br>> > (let ((f (new dialog% (label "Hello"))))<br>> > (new button% (parent f)<br>> > (label "Me, Me!")<br>> > (callback (lambda _<br>> > (send f show #f)
<br>> > (return "Escaping"))))<br>> > (send f show #t)<br>> > "Did not Escape")))<br>> ><br>> > (go)<br>> ><br>> ><br>
> ><br>> > Evaluate to "Escaping" when the user clicks the "Me,Me!" button?<br>> ><br>> ><br>> ><br>> ><br>> > _________________________________________________
<br>> > For list-related administrative tasks:<br>> > <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>><br>><br>> _________________________________________________
<br>> For list-related administrative tasks:<br>> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br><br></blockquote></div><br>