From: Pit Capitain Date: 2003-02-04T19:01:17+09:00 Subject: Re: Local variables & blocks On 4 Feb 2003 at 14:27, Jim Weirich wrote: > (... Y combinator ...) > > As a final thought along the recreational uses of "proc", I leave you > with the following code inspired by the thread on block and local > variables. > > def weird > x = nil > [proc {x}, proc {|x|}] > end > > What does it do? Hint: This works in the current version of Ruby, but > it will fail when/if Matz ever implements the new rules for blocks and > local scope. 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? Regards, Pit