From: Glen Date: 2006-02-17T09:08:28+09:00 Subject: Re: recontextualizing a block (looking for deep magic) Phil Tomson wrote: > I'd like something like: > > def runit &b > a = 42 > pnew = Proc.new &b, binding > pnew.call > end > > runit { puts "a is: #{a}" } > > #would print: > a is: 42 Hi, I am not sure I understood your question, and since noone else has suggested this yet, I assume that it is not what you are looking for. But I will post it anyway. Does this do what you want? def runit &b a = 42 pnew = Proc.new(&b) pnew.call(a) end runit { |a| puts "a is: #{a}" } -- Glen