question - blocks
Avi Bryant
avi at beta4.com
Wed Jul 24 07:59:13 UTC 2002
On Sun, 21 Jul 2002, haldane wrote:
> |temp|
> temp := (1 to: 100) collect: [:i| Nothing message: [i]].
<snip>
> How can I force the i inside the [] to the number it represents.
The problem you're seeing is the lack of full block closures in Squeak.
Thanks to work by Anthony Hannan, this has been fixed for the VI4
image, but that likely won't be part of a stable release for some time.
The workaround in the meantime is the #fixTemps message. If you change
the above code to
> |temp|
> temp := (1 to: 100) collect: [:i| Nothing message: [i] fixTemps].
then it should work as you expect.
Avi
More information about the Squeak-dev
mailing list
|