From: "Mauricio Fernández" Date: 2004-04-19T07:25:09+09:00 Subject: Re: New Local Variable Scope rule On Mon, Apr 19, 2004 at 04:14:10AM +0900, Dave Brown wrote: > In article <4082CA8A.7010605@weirichhouse.org>, > Jim Weirich wrote: > : David Alan Black wrote: > : > Is a 'local' keyword being introduced in 2.0? I can't find mention of > : > it. > : > : All local would be is ... > : > : def local > : yield > : end > > Hrmm. Not QUITE. It complained at me when I tried that. [ruby-talk:64791] I'm not sure |a| will accept an arbitrary num. of args. in the future (you might need |*a|). > A slight variation on that though... > > irb(main):007:0> def local(&block);yield block;end I don't think this is doing what you think it is doing ;-) >> def local(&block);yield block;end => nil >> local{|x| p x} # => nil for the matter, >> def local; yield 1;end (irb):3: warning: method redefined; discarding old local => nil >> local{|x| p x} 1 => nil >> local{|a,b,c| } => nil -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com i dont even know if it makes sense at all :) This is an experimental patch for an experimental kernel :)) -- Ingo Molnar on linux-kernel