[squeak-dev] Scheme continuations vs Squeak continuations

Stéphane Rollandin lecteur at zogotounga.net
Fri Jan 30 17:02:08 UTC 2009


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





More information about the Squeak-dev mailing list