From: DK Date: 2007-03-03T05:15:06+09:00 Subject: Re: Hash keys don't work as expected > > 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 > > which all is necessary in order to have mutable keys, I guess that it > is very difficult to think about that in the beginning when not yet > used to it. I understand now. I can see how looking up keys by their hash rather than their object_id is more appropriate. > BTW. I try to avoid to mutate hash keys, I know my limits ;) Agreed. I was just curious about how things worked underneath. Thanks for all the responses. -DK