[squeak-dev] Temporary Variables and Blocks

Anthony Kaufman anthony.kaufman at gmail.com
Mon Jun 15 22:44:54 UTC 2009


Hi, I've been programming smalltalk for a couple of years (VisualWorks  
for the most part) and recently ran into something I'm not quite sure  
what to do with:

callbacks := OrderedCollection new.
(Array with: 1 with: 2 with: 3) do: [ :each | callbacks add:  
[ Transcript show: each asString ] ].
callbacks do: [ :each | each value ]

In Squeak, my transcript shows 333 while in VisualWorks, 123 which I  
would expect. What's going on here and is there anything I can do  
about it? I'm sure this question isn't a new one but I wasn't able to  
articulate my Google and mailing list searches in such a way that gave  
me an answer.

Thanks,
Anthony



More information about the Squeak-dev mailing list