From: wys@... (Clemens Wyss) Date: 2001-02-08T19:40:02+09:00 Subject: [ruby-talk:10559] Re: Giving a Proc utility methods? IMHO: The reason for this behavior is, that the block closure "takes" its binding upon its creation time, which in your case is the "main context" of the program. This means you would have to define fail() in the global scope in order to let the block code see it. The block closure object (class Proc) is just a wrapper consisting of the code (i.e. the block) and the binding, but it is NOT the scope of the block(-code). Don't know whether you like this solution better: class Foo attr :err def initialize (&meth) @err = meth end def fail (msg) puts msg end def throw_err (msg) @err[msg, self] end end # I want to preserve this closure... bar = "testing..." # Example showing the callback works my_foo = Foo.new {| msg, other | puts msg + bar} my_foo.throw_err "Trial 1: " # Example of what I *wanted* to do... my_foo = Foo.new {| msg, other | other.fail (msg + bar)} my_foo.throw_err "Trial 2: " Clemens (the other ;-)