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?<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;">
There 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></blockquote></div><br>