Z
Zhi-Qiang Lei
Dear All,
Why is there still NameError?
ruby-1.9.2-p0 > l = ->{ h }
=> #<Proc:0x000001009d7eb0@(irb):1 (lambda)>
ruby-1.9.2-p0 > l.call
NameError: undefined local variable or method `h' for main:Object
from (irb):1:in `block in irb_binding'
from (irb):2:in `call'
from (irb):2
from /Users/siegfried/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
ruby-1.9.2-p0 > h = 1
=> 1
ruby-1.9.2-p0 > l.call
NameError: undefined local variable or method `h' for main:Object
from (irb):1:in `block in irb_binding'
from (irb):4:in `call'
from (irb):4
from /Users/siegfried/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
Best regards,
Zhi-Qiang Lei
(e-mail address removed)
Why is there still NameError?
ruby-1.9.2-p0 > l = ->{ h }
=> #<Proc:0x000001009d7eb0@(irb):1 (lambda)>
ruby-1.9.2-p0 > l.call
NameError: undefined local variable or method `h' for main:Object
from (irb):1:in `block in irb_binding'
from (irb):2:in `call'
from (irb):2
from /Users/siegfried/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
ruby-1.9.2-p0 > h = 1
=> 1
ruby-1.9.2-p0 > l.call
NameError: undefined local variable or method `h' for main:Object
from (irb):1:in `block in irb_binding'
from (irb):4:in `call'
from (irb):4
from /Users/siegfried/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `<main>'
Best regards,
Zhi-Qiang Lei
(e-mail address removed)