From: "T. Onoma" Date: 2003-11-29T18:13:27+09:00 Subject: Re: Controlled block variables On Friday 28 November 2003 11:49 pm, Pit Capitain wrote: > So the trick is to use a proc as shown above and use it as a method, > which can be done with define_method: > > a = [1,2,3] > self.class.class_eval "define_method :ameth, proc{ p a }" > ameth > > results in > > [1, 2, 3] > > If I understood you right, this is what you wanted. Okay, I think I know what you're saying. So you're defining a method for the variable that would be visible from within the def. Another viable solution. Sorry, I wasn't able to pick up on this from the frist post. I image we could even abstract this further using: class Object def methodize(sym, var) class_eval "define_method "#{sym}meth", proc{ var }" end end or something to that effect. Thanks! -t0 P.S. Did you see Austin's post on core?