I'm a bit confused by the scope of local variables.

$ irb --simple-pompt
>> foo = "bar" 
=> "bar"
>> def function
>>     puts foo
>> end
=> nil
>> function
NameError: undefined local variable or method `foo' for #<Object:0xf9000>
        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'?

-- 
Daniel Carrera
Graduate Teaching Assistant.  Math Dept.
University of Maryland.  (301) 405-5137