From: Yukihiro Matsumoto Date: 2007-02-05T03:37:33+09:00 Subject: Re: Hash#rekey Hi, In message "Re: Hash#rekey" on Mon, 5 Feb 2007 03:08:15 +0900, "Trans" writes: |> No. "foo" and :foo are different keys in a hash. | |And never the twain shall meet? So it's long live |HashWithIndifferentAccess ? The HashWithIndifferentAccess behavior will not be default even after Ruby 2.0; that's for sure. |A while back I offered the idea of being able to define a key coerce |proc, eg. | | h = Hash.new.key!{ |k| k.to_s } | |Such that keys would always be strings. Might someting like that be a |viable solution? Maybe, but not with a name like "key!". |In anycase, I still offer up #rekey. I don't think "rekey" represents the behavior well. Any better name? transpose_keys comes to my mind. matz.