WoNáDo
1/19/2007 5:45:00 PM
Yukihiro Matsumoto schrieb:
> Why object_id? Isn't it more useful to return the receiver itself,
> e.g.
>
> myhi.receiver # => #<Hugo:0xb7d5ff40>
>
> ?
>
> And why should method_name return combination of class name and method
> name? I think the method_name should return the method name only
> ("hi" for this case). It may be useful to implement separate method
> to get a class that holds the method.
I agree, because I'm only interested in the information at all. If you find a
better format or better way to present it, its fine.
One question is open for 'myhi.receiver # => #<Hugo:0xb7d5ff40>'.
First, the format requires a pattern matching on the result, if the object-id
ist needed only. May be two seperate methods are better, as you suggested for
'method_name'.
In additon, a format for the seperate method, that returns information about the
class that holds the method, may be complicated for singleton methods. An
example is '#<Method: #<Hugo:0x2ae6e54>.private_hi>'.
Wolfgang Nádasi-Donner (WoNáDo)