From: "Kroeger, Simon (ext)" Date: 2006-01-24T21:02:21+09:00 Subject: Re: Making Array#uniq work > -----Original Message----- > From: Damphyr [mailto:damphyr@freemail.gr] > Sent: Tuesday, January 24, 2006 12:35 PM > To: ruby-talk ML > Subject: Making Array#uniq work > > OK, according to the Pickaxe 2nd. Edition, Array#uniq judges > uniqueness > based on eql?. Somehow this doesn't seem to work for me :). > Following code returns the Array with two members instead of > the one I > would wish for. Any pointers? I'm running 1.8.2 Hi, you have to define a 'hash' method because Array uses a Hash to remove the duplicates. e.g.: ---------------------------------------------------------- class A attr_accessor :a,:b def initialize a @a=a @b=Array.new end def << item @b<