From: Jim Weirich Date: 2003-02-04T21:39:34+09:00 Subject: Re: Local variables & blocks On Tue, 2003-02-04 at 05:01, Pit Capitain wrote: > Hi Jim, > > thanks for the weird Y fun :-) > > Isn't your weird the same as > > def weird > x = nil > [proc {x}, proc {|v| x=v}] > end > > and wouldn't this work under the new rules, too? Yes, it is the same. While thinking about the proposed rules for block and local scope, I was just struck by the weird symmetry between {x} and {|x|}. And while we have mentioned the new scoping rules, I think the new rules are fine. They are simplier and more regular than the existing rules. Its a little odd to declare block local varaibles using the "local" trick, but then it kinda neat that the language can handle that as well without any special rules. -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)