From: Robert Klemme Date: 2004-04-14T23:09:12+09:00 Subject: Re: New Local Variable Scope rule "ts" schrieb im Newsbeitrag news:200404141329.i3EDTsS21496@moulon.inra.fr... > >>>>> "R" == Robert Klemme writes: > > R> def foo(&b) > R> [1].each &b > R> puts c > R> end > R> foo { c = 0 } > > R> 'c' comes into existence in the lexically surrounding scope, i.e. foo in > R> the first case and the calling context in the second case. There is no > R> magic that would make the second example print something other than 'nil' > R> for 'c'. > > Well, it will just give > > in `foo': undefined local variable or method `c' Exactly. robert