From: Robert Dober Date: 2007-05-21T01:36:27+09:00 Subject: Re: Calling a block with parameters in a new scope On 5/20/07, Phrogz wrote: > On May 19, 10:07 pm, Ruby Talk wrote: > > self.instance_eval &block > > > > And calling a block, passing it parameters is easy enough: > > > > block.call(*params) > > > > But is there some way to do both? To both change the scope of evaluation > > and pass variables into the block. > > http://eigenclass.org/hiki.rb?instance_exec > > > OP We have just discussed this twice recently, maybe you should browse the recent posts... Phrogz: Your link seems outdated, c.f.http://eigenclass.org/hiki/bounded+space+instance_exec for a discussion of #undef_method (bad) vs. #remove_method (good) and please note the potential danger of endless recursion. Cheers Robert -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw