From: Yukihiro Matsumoto Date: 2007-09-17T09:42:16+09:00 Subject: Re: Modifying a hash key Hi, In message "Re: Modifying a hash key" on Sun, 16 Sep 2007 17:10:05 +0900, Alex Shulgin writes: |This suggests me that the keys are actually stored in the hash by |reference, not by value as I would expect from my prior experience |with other languages. Hash stores its values, as its name suggests, by hash values from keys. So, if you modifies the key, and subsequently the hash value of the key, it screws up. As a general rule, don't modify the keys, or if you really need to modify the key for some unknown reason, call rehash method on the hash. FYI, as a special exception, string keys for hashes are copied for practical reasons. matz.