Gregory Brown wrote:
> Not that I'm implying this is necessarily 'ok' but you had the same
> mistake in your last post, reading Object's docs and applying them to
> another class.

I think that if there is a description of hash or eql? or any other 
method for Object and no description of this method in class X (X < 
Object, of course) then the contract and general behaviour is inherited. 
So it's not my mistake. If I want to learn about Float#hash and there's 
no description of hash under Float then I search for the description in 
Float's ancestors, until I find it, no further than under Object. And it 
should apply to Floats as well.

Apart from that, if you prefer, I can call {[o]=>0}, and not directly 
call Array#hash, and I get the same error of course. And now you cannot 
say that I try to apply what I read about Object to Array, because now, 
from the user point of view, there's simply something wrong, it doesn't 
work even though I did everything OK, I redefined o.hash in a way that 
is consistent with the reference for Object#hash.

For me that's a bug.
-- 
Posted via http://www.ruby-forum.com/.