From: Yugui Date: 2009-11-07T20:06:07+09:00 Subject: [ruby-core:26584] Re: HashWithIndifferentAccess to core 2009/11/6 Yukihiro Matsumoto : > |How about "Hash#compare_as_string_key" following in > |"Hash#compare_by_indentity"? > > It's much better than HashWithIndifferentAccess. I agree. I'm strongly against StrHash itself because of the reasons which matz mentioned. String is not Symbol, Symbol is not String. It is useful in a particular case but Ruby is a general purpose language. When you need different-access, you can implement "your language" on top of Ruby like HashWithDifferentAccess. This is a good point of Ruby. compare_as_string_key is much more acceptable. But it still seems to be just for Rails. How about Hash::Type class as an API for rb_hash_type? It means, generalizing compare_by_identity and HashWithDifferentAccess to strategy object that represents how to compare the keys. Thanks, -- Yuki Sonoda (Yugui)