From: Rolando Abarca Date: 2008-10-17T09:39:19+09:00 Subject: about lambda and its binding is there a way to specify the binding of a proc created through lambda? eg: $ cat test.rb class A attr_reader :foo def initialize @foo = lambda { do_that_thing } end end class B def do_that_thing puts "yeah, do it!" end def initialize a = A.new a.foo.call end end B.new $ ruby test.rb test.rb:4:in `initialize': undefined local variable or method `do_that_thing' for #> (NameError) from test.rb:15:in `call' from test.rb:15:in `initialize' from test.rb:19:in `new' from test.rb:19 So... is there a way to call the lambda defined in A with the binding of B? thanks a lot for any hint... -- Rolando Abarca M.