In other words, why can't I do this?
def f(b) eval("x = 10", b) end
f(binding) puts "x = #{x}"
Is there any way to make that code work (besides obviously setting x to something before calling f).
Thanks.
In other words, why can't I do this?
def f(b) eval("x = 10", b) end
f(binding) puts "x = #{x}"
Is there any way to make that code work (besides obviously setting x to something before calling f).
Thanks.
In other words, why can't I do this?
def f(b) eval("x = 10", b) end
f(binding) puts "x = #{x}"
This seems relevant: http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a954f8aaf698a0b9/e1c761b71b63b82e?#e1c761b71b63b82e
Fred