Idea for a possibly better Collection occurrencesOf method.

Klaus D. Witzel klaus.witzel at cobss.com
Wed Sep 13 13:14:02 UTC 2006


Hi Lukas,

on Wed, 13 Sep 2006 14:59:42 +0200, you wrote:

>> turning the suggested primitive behind BlockContext>>#apply:from:to:  
>> into
>> a #primitiveValue is, after checking receiver and arguments, easy.
>
> How does that work together with continuations?

:) Nice question, important as well.

> I guess the state
> (iteration index) is stored in the C stack and cannot be captured by
> looking at thisContext, right?

No, nothing can be stored in the C stack. Say we have ... apply: seqColl  
from: here to: there, then at each iteration the VM does here := here + 1  
(that's a privilege of the VM). Later when #commonReturn comes back, the  
situation is precisely as it was at the time of the first call, expect  
that argument 'here' reflects the progress. And kangaroo and debugger and  
friends are not affected.

It is because of the latter that I'd say that that works in harmony with  
continuations.

/Klaus

>
> Lukas
>





More information about the Squeak-dev mailing list