From: Robert Klemme Date: 2005-09-20T00:01:37+09:00 Subject: Re: help with tricky proc/binding issue Ara.T.Howard wrote: > i'm trying to be able to define a proc that can be called in the > context of self, eg: > > block = lambda{ p 42 } > an_obj.instance_eval &block > > but which can also be called with arguments, for example (imaginary > ruby): > > b = lambda{|x| p [x, y]} > > class C > def y; 42; end > end > > c = C::new > x = 42 > > c.arg_instance_eval(x, &b) #=> [42, 42] > > any ideas? The only workaround that comes to mind is to pass self explicitely along with other arguments. Or use a trick with delegation that allows to do instance_eval on a proxy self that will also provide arguments given. robert