"Yukihiro Matsumoto" <matz / ruby-lang.org> schrieb im Newsbeitrag news:1044033836.111446.7865.nullmailer / picachu.netlab.jp... > Hi, > > In message "Re: Local variables & blocks" > on 03/02/01, "Robert Klemme" <bob.news / gmx.net> writes: > > |Ok, I include another example to check whether I got it right: > > Unfortunately, wrong, even in the current behavior. Darn. > | if defined? bar > > The "defined?" status resolved at compile time, so that this never be > true, even after the first iteration, since there's no preceding > assignment to the variable "bar". Ok, then I did not get it right. I'll ask the other way round. What is the proposed behavior of this: def blocktest(*args) args.each do |arg| foo = "yes" end p foo end blocktest(1,2,3) blocktest() If I do understand the thread correctly, 'foo' will not be local to the block - just 'arg' will. So 'foo' will always be defined in 'blocktest()'. Sorry for beeing so slow on this one. Kind regards robert