From: Marcin Wolski Date: 2010-06-11T01:00:48+09:00 Subject: Re: comparing objects Rein Henrichs wrote: > On 2010-06-10 07:20:03 -0700, Mark Abramov said: > >> Mark Abramov wrote: >>> [tl;dr] >> >> Sorry, guys, didn't notice how I used eql instead of eql? >> Btw, without #hash it won't work anyways which I consider *weird* at the >> very least. > > #hash makes sense for Hash#[] and etc. #eql? makes more sense for > Array#&. I too find it odd that both are necessary. If two objects are set to be eql?, their hash methods must also return the same value. More details in The Ruby Programming Language book. Thus, when you redefine eql?, the hash methods also should be redefined. -- Posted via http://www.ruby-forum.com/.