From: Pit Capitain Date: 2006-12-28T01:52:20+09:00 Subject: Re: Using an UnboundMethod instead of an alias to redefine a method Phrogz schrieb: > To slightly hijack this thread (only slightly, since overriding methods > is being discussed)...do any of you smart participants know the answer > to the thread I posted Christmas eve, titled "Method equality; setting > instance variables on Method instances"? > > http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/951b2a42731ab66b > > I suspect I'm not coming up with anything better than the other methods > discussed here, but it grates on me that I can't figure out what's > going on. Sorry I didn't answer your original post. I waited until somebody else would answer it, and then I forgot it :-( This has been brought up several times. I'm sure Tom aka trans can tell you a lot about this. Look at the following IRB session: irb(main):001:0> Kernel.method( :puts ).object_id => 24666490 irb(main):002:0> Kernel.method( :puts ).object_id => 24661050 Module#method always creates a new Ruby object around the internal method implementation. Currently you have to cache your method objects in order to be able to retrieve them later. Regards, Pit