From: Mark Abramov Date: 2010-06-10T23:07:48+09:00 Subject: Re: comparing objects Benoit Daloze wrote: > 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 > For me it doesn't work anyway. Unsure how to paste code here, you could see an example here: http://pastie.org/999353 I am still like "WTF?" $ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0] -- Posted via http://www.ruby-forum.com/.