[squeak-dev] The Trunk: System-cwp.660.mcz

Colin Putney colin at wiresong.com
Sun Jan 12 14:22:29 UTC 2014


On Sat, Jan 11, 2014 at 6:40 PM, Florin Mateoc <florin.mateoc at gmail.com>wrote:


> No, by following the proxy's nextObject, we start iterating a different
> loop than the original one (constituted by the bunch of objects just
> created, the proxy being the oldest in the bunch) until we reach the newest
> one among them, which will return 0.
>

I'm pretty sure there's just one loop. #allObjectsDo has one #whileFalse:
message, and it keeps iterating until we reach 0.


> The sentinel is there because, even if only one block activation is
> created, we do not want to include it in the iteration, otherwise a check
> for 0 would be good enough.
>

According to the comment Andreas wrote, the sentinel is there to prevent an
infinite loop.


> If you open code the loop (say [(next := next nextObject) ~= 0] whileTrue:
> [...loop body...]) there is no block activation, so a check for 0 would be
> enough (if we don't otherwise create new objects).
>

 There *is* a block activation, because the loop body sends #value: to
aBlock.

Colin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140112/c1b5a965/attachment.htm


More information about the Squeak-dev mailing list