On Jun 20, 2006, at 9:25 AM, Matthew Smillie wrote:

> 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 ==.

Can't be that:

 >> str1 = "a"
=> "a"
 >> str2 = "a"
=> "a"
 >> str1.object_id == str2.object_id
=> false
 >> [str1, str2].uniq
=> ["a"]

James Edward Gray II