From: Matthew Smillie Date: 2006-06-20T23:25:54+09:00 Subject: Re: uniq() Oddity On Jun 20, 2006, at 15:17, James Edward Gray II wrote: > a = [ { :foo => :bar }, { :foo => :bar } ] > > p a #=> [{:foo=>:bar}, {:foo=>:bar}] > p a[0] == a[1] #=> true > # why does this next call do nothing? > p a.uniq #=> [{:foo=>:bar}, {:foo=>:bar}] Seems to compare on object id, rather than with ==. I couldn't speculate on any more significant answer to 'why?' a[0].id == a[1].id => true b = [a[0], a[0]] b.uniq => [{:foo=>:bar}] matthew smillie.