[squeak-dev] Continuations

Lukas Renggli renggli at gmail.com
Wed Mar 11 07:19:33 UTC 2009


> Are my expectations wrong?  Are there bugs in the Seaside implementation of
> Continuations?  Or what?

When you evaluate the line

   c := d countUpTo: 7

to capture the continuation the first time the answered continuation
includes the assignment to c, as well as the rest of the doIt or
printIt you used to evaluate the expression.

The first time you evaluate

    c value: 15

the code assigns a new continuation to c (one starting at 15) and ends
with the previous doIt. The next time you evaluate

    c value: 15

the continuation c is different, thus starts at 15 and counts up to 1000.

So as far as I understand, everything seems to be fine.

The problem could be solved by moving the assignment into the [ :cc |
^ cc ]-block and assigning to an inst-var or global.

Seaside 2.9 comes with partial continuations, where you could stop the
capture right before the assignment to avoid the problem.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list