From: Pit Capitain Date: 2007-08-03T17:11:27+09:00 Subject: Re: #send in 1.9 2007/8/3, Joel VanderWerf : > Pit Capitain wrote: > > To Tom and others using #send to call private methods: if the method > > name is known, then you should immediately change > > > > obj.send("method", *args) > > > > to > > > > obj.instance_eval { method(*args) } > > That rewrite can be a source of errors if instead of "args" you have > some expression that depends on self: > > obj.send("method", x, y) # x and y are methods of self > > can be rewritten as: > > args = [x, y] > obj.instance_eval { method(*args) } Good catch, Joel. It never happened to me, but you're right: the two snippets I've shown are not equivalent. Thanks for pointing this out. Regards, Pit