From: Paul Brannan Date: 2002-02-20T00:08:01+09:00 Subject: Re: alias danger On Tue, Feb 19, 2002 at 06:05:44AM +0900, Joel VanderWerf wrote: > The other half of the problem would be solved if you could use a local > var instead of a constant, and capture it in a closure. Is there > something in 1.7 like this? > > module M > unbound_foo = instance_method :foo > define_method :foo { > p "foo1" > unbound_foo.bind(self).call > } > end Sort of, but you won't get access to "self" or to any instance variables. See [ruby-talk:29122] for one possible solution. Paul