From: Benoit Daloze Date: 2010-06-07T07:03:30+09:00 Subject: Re: comparing objects --0016e65aeea2c30841048863b975 Content-Type: text/plain; charset=ISO-8859-1 Hi, Just wanting to add my thoughts about this (I made a thread about this a few months ago). I searched a bit and concluded this: Array methods using comparison - with #hash and #eql? &, |, uniq(!), - - with #== include?, (r)assoc, count, delete, (r,find_)index (please say me if I forgot one) I think Array methods should never have to look at #hash and #eql? methods. I suppose this is done for performance. I think this should change, because: - it violates POLS - it can make unexpected behavior because you defined #hash and #eql? , for objects which should not need that (when you manage objects in an Array, you do not expect to need to think about Hash's keys). - it is not consistent with other Array's methods PS: Rein: I saw your implementation of #hash. I think to "add one" is useless, because #eql? is always used (so even if #hash was always the same, it would work). It could maybe speed up a bit, but only if you have a lot of comparison of User and User's instances, which is very unlikely. --0016e65aeea2c30841048863b975--