[squeak-dev] Continuations

Andrew P. Black black at cs.pdx.edu
Wed Mar 11 19:24:16 UTC 2009


Thank you.  In formulating my question, I had begun to think as  
much ... that the assignment was being captured and re-done.
Hence, the different behaviour with the inspector.  However, previous  
discussion (Subject: Scheme Continuations) had led me to believe that  
implicitly declared workspace variables were indeed treated like  
globals.

I still don't understand where the "nil" comes form, though.


On 11 Mar 2009, at 00:19, Lukas Renggli wrote:

>> 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