From: Yukihiro Matsumoto Date: 2011-03-02T09:04:44+09:00 Subject: [ruby-core:35408] Re: Why are hash keys sometimes duped? Hi, Eric, your guess is correct. It's a compromise between mutable strings and rehashing. matz. In message "Re: [ruby-core:35407] Re: Why are hash keys sometimes duped?" on Wed, 2 Mar 2011 08:29:59 +0900, Eric Wong writes: | |Aaron Patterson wrote: |> Why are some objects duped when they are used as hash keys and other |> objects are not? | |I've always wondered this, too, or rather why strings are duped + frozen |while Arrays and other objects are not. I speculate that strings are |just commonly used as keys and also often modified and it allows users |to avoid needing to rehash. | |I'd definitely like to see Matz's response to this. | |-- |Eric Wong