From: Matt Mower Date: 2005-01-08T19:01:02+09:00 Subject: Re: Strange behavior of hash key Hi Traz, On Sat, 8 Jan 2005 17:51:25 +0900, Traz wrote: > >Because Hash uses Object#eql? to test for equality it makes them > >different keys and hence your example fails. > > Matt, string keys have the same behaviour, no ? : > >> "one".object_id > => 22476232 > >> "one".object_id > => 22473868 > I think the answer here is that String redefines the eql? method to compare content instead of 'object_id' so String literal keys will work. > >This behavior is changing in 1.9: > Thank Joel ! So finaly, it was a bug in 1.8 ? > Did they define Hash#eql? in 1.9? Regards, Matt -- Matt Mower :: http://matt.blogs.it/