[squeak-dev] Scheme continuations vs Squeak continuations

Eliot Miranda eliot.miranda at gmail.com
Fri Jan 30 18:01:30 UTC 2009


Stéphane,
    if you mail me your code and test case I'll run it in the Cog closure VM
and see if it works there.

On Fri, Jan 30, 2009 at 9:02 AM, Stéphane Rollandin
<lecteur at zogotounga.net>wrote:

> hello list,
>
> I realized yesterday that my scheme implementation in Squeak failed to
> evaluate properly the so-called "mondo bizarro" code:
>
> (let ((y (call-with-current-continuation (lambda (c) c))))
>    (display 1)
>    (call-with-current-continuation (lambda (c) (y c)))
>    (display 2)
>    (call-with-current-continuation (lambda (c) (y c)))
>    (display 3)))
>
> ... which should display "11213"
>
> instead, it writes "11" then goes on forever printing "2"
>
> I wrote the equivalent code in Smalltalk:
>
> y _ Continuation currentDo: [:c | c].
> Transcript show: 1.
> Continuation currentDo: [:c | y value: c].
> Transcript show: 2.
> Continuation currentDo: [:c | y value: c].
> Transcript show: 3.
>
> and it appears the (wrong) behavior is the same.
>
> is anyone expert enough in continuations to help me fix this ?
>
> (the Continuation class used here is from Seaside)
>
>
> Stef
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090130/cd4a48d1/attachment.htm


More information about the Squeak-dev mailing list