Artem Voroztsov
4/18/2008 9:54:00 AM
Maybe it contains.
But please, explain me why "block binding" does not print a, b, and c
variables.
def vars(&block)
b = block.call(55)
puts "inner binding: ", eval("local_variables", b)
puts "block binding: ", eval("local_variables", block.binding)
end
vars {|a|
b = 1
c = 2
binding
}
My output:
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
inner binding:
c
b
a
block binding: