[FIX] out of scope access to block args
Tim Rowledge
rowledge at interval.com
Mon Oct 11 00:29:50 UTC 1999
On Sun 10 Oct, Lex Spoon wrote:
>
> bogoMethod
> self foo: [ :x | x + 1 ].
> ^x + 2.
[snip]
> Do people think this construct is a good idea? And isn't this construct
> at odds with the goal of re-entrant blocks which have fresh argument
> variables with each call?
It certainly isn't a good construct! As you say, it would make life a
bit confusing if proper Closures were introduced. The Parser/Encoder
ought to complain about it, just as it ought to complain about
bogoMethod2
self foo: [ :x | |y| x + y ].
^y + 2.
but doesn't. To be honest, it's probably not worth much effort to fix,
since we should have Closures soon. Shouldn't we?
tim
--
Spelling checkers at maximum! Fire!
Tim Rowledge: rowledge at interval.com (w) +1 (650) 842-6110 (w)
tim at sumeru.stanford.edu (h) <http://sumeru.stanford.edu/tim>
More information about the Squeak-dev
mailing list
|