From: Robert Klemme Date: 2007-03-03T03:55:07+09:00 Subject: Re: Hash keys don't work as expected On 02.03.2007 19:28, Tim Hunter wrote: > DK wrote: >> On Mar 2, 12:58 pm, Tim Hunter wrote: >>>> => {[1, 2, 3]=>"test"} >>>> DK >>> Posted viahttp://www.ruby-forum.com/. >> Ah, thank you. Why is this necessary? Isn't the lookup just a matter >> of matching object_id's? > > Remember that hash values are distributed into buckets based on their > key. Change the key, change the bucket. More precisely if the hash of the key changes the bucket changes. And since Array calculates it's hash based on the content changing the content means changing the key. And, to the OP, lookups in Hashes are not done via #object_id but via #hash: http://en.wikipedia.org/wiki/Hashtable Kind regards robert