From: gwtmp01@... Date: 2007-01-21T00:55:57+09:00 Subject: Re: Minor Change Proposal for Classes 'Object' and 'Method' On Jan 20, 2007, at 10:20 AM, Wolfgang N�dasi-Donner wrote: > Vincent Fourmond schrieb: >> gwtmp01@mac.com wrote: >>> Method#receiver >>> Method#name >>> Method#origin # module/class with definition of method >>> >>> Kernel#origin(name) # module/class where named method is found >>> # via standard method lookup process on the >>> # receiver. >>> # nil if no matching method found >> I vote for the last one too ! >> Vince > > An additional method "Kernel#origin(name)" will be helpful, if the > method is defined as a singleton method for an object, it is > difficult to get the object_id of the anonymous class, where the > method ist defined (I hope this sentense is somehow understndable). > > The object_id is necessary in comparisons with the result of the > call to the method of class "Method", that returns the associated > class. I was assuming that Method#origin and Kernel#origin would both return a reference to the class/module. In fact, Kernel#origin is really just short for method(name).origin and of course you can just call object_id on the module/class reference as needed. It appears that you are viewing the (proposed) return value of Method#origin and Kernel#origin as a string and not as a reference to the module/class itself as intended by myself and the other posters. Gary Wright