[BUG?] Bad scoping in a DoIt
Doug Way
dway at riskmetrics.com
Wed Feb 27 18:28:27 UTC 2002
Brian Keefer wrote:
>
> If I put this in a Workspace and doit each line separately, it prints
> true. If I highlight it all and doit, it prints nil. Is there some hidden
> meaning that this newbie's missing?
>
> a_true.
> b_[ |a| a_false].
> Transcript show:a.
The basic answer is: Using temporary variables inside a Block is currently a hack in Squeak, so you should expect weirdnesses if you try to do anything remotely unusual with them.
Block Closures will fix this problem, but Squeak doesn't yet support closures. Work is being done in this area right now, though, and there is an upcoming VM ("v4") which will support closures (which you can look for on the Swiki if you want to try it). See the recent threads on this list about block closures.
- Doug Way
dway at riskmetrics.com
More information about the Squeak-dev
mailing list
|