[BUG?] scope of block arguments too large
Lex Spoon
lex at cc.gatech.edu
Mon Dec 20 18:54:36 UTC 1999
>
> I noticed that the following statement is NOT an compilation error - as I'd
> suspect but evaluates to "2".
>
> #(1 2) do: [:i | i].
> i
>
> I'm aware of that this happens because of the way, block arguments are
> dealt with but still, it's a source of difficult to find errors.
>
You're right. Maybe when closure support is added, the compiler will
be rewritten, and at that point this scope violation will be
fixed.
Lex
More information about the Squeak-dev
mailing list
|