From: nobu.nokada@... Date: 2003-01-21T04:39:06+09:00 Subject: Re: Local variable scope Hi, At Tue, 21 Jan 2003 04:32:59 +0900, Daniel Carrera wrote: > $ irb --simple-pompt > >> foo = "bar" > => "bar" > >> def function > >> puts foo > >> end > => nil > >> function > NameError: undefined local variable or method `foo' for # > from (irb):3:in `function' > from (irb):5 > > Since 'foo' was defined before 'function' and both 'function' and 'foo' > are in the same scope (I think) shouldn't 'function' see 'foo'? Any methods have each own scopes. -- Nobu Nakada