From: Robert Klemme Date: 2003-02-03T18:53:31+09:00 Subject: Re: Local variables & blocks "Yukihiro Matsumoto" schrieb im Newsbeitrag news:1044263814.840935.970.nullmailer@picachu.netlab.jp... > Hi, > > In message "Re: Local variables & blocks" > on 03/02/03, "Robert Klemme" writes: > > |I just wonder what the second invocation of blocktest() will print. Since > |there is no iteration, no assignment to 'foo' will have taken place. Is > |this an error or will 'foo' be initialized with 'nil'? I guess 'nil' > |initialization will be more reasonable because it saves an additional test. > > nil. Right again. ;-) Great! :-) So the only drawback I can see is that we have to take care that we don't accidentally clutter the enclosing scope with huge temporary data like in: def test() Proc.new do |arg| tmp = makeHugeTemp() end end But I think this is a rather unlikely case: if the operation is so complex that it needs such amounts of temp data it will be put into a method anyway. Regards robert