From: Jacob Fugal Date: 2005-08-31T03:58:22+09:00 Subject: Re: Method behaves differently when called using #send On 8/30/05, Trans wrote: > > Jacob Fugal wrote: > > > > class Object > > def instance_send( symbol, *args, &block ) > > instance_eval { send( symbol, *args, &block ) } > > end > > end > > Nice, that would suffice (IMHO) Oh, and just looking at this again after your reply, I noticed the the instance_eval isn't even necessary since we're inside the instance in the body of instance_send anyways: class Object def instance_send( ... ) send( ... ) end end That removes one level off the call stack. The stack in this circumstance would be one deeper than send with an explicit receiver, but not as deep as with an exterior instance_eval (since you have to enter instance_eval and then enter the provided block from there). I don't think the slight inefficiency compared to send with an explicit receiver is a problem. If it does turn into a problem, one can use #method and Method#call instead, right? Jacob Fugal