From: Trans Date: 2007-02-05T03:08:15+09:00 Subject: Re: Hash#rekey On Feb 4, 11:28 am, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Hash#rekey" > on Sun, 4 Feb 2007 04:49:08 +0900, "Trans" writes: > > |I think he backed off making Symbol a subclass of String, but I think > |he's still considering auto-coercing symbol to string, or at the very > |least that they will have some sort of equality for use as hash keys. > |Matz? > > No. "foo" and :foo are different keys in a hash. And never the twain shall meet? So it's long live HashWithIndifferentAccess ? 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? In anycase, I still offer up #rekey. T.