From: Trans Date: 2006-12-27T04:57:06+09:00 Subject: Re: Hash with two identical keys? Trans wrote: > Trans wrote: > > thanks Ara and Jon, > > > > I see what your saying. I was using #== not #eql? in comparing the > > keys. So I see why it's faling now. How do I get aorund this? I'm > > caching object based on therr initialization paramaters, which has to > > be an array. Is there a simpler way or do I have to do something like: > > > > class Parameters < Array > > alias :eql? :== > > end > > Ugh. Nothing like that works either. It's not using eql? or equal?, but > rather #hash (I guess that's actually what you were trying to say Ara). > This doen't make any sense to me. Why do identical strings and arrays > have the same #hash value but not hashes? Nope. It doesn't even use #hash. So it must be using #object_id with an exception for Strings and Arrays. Dissapointing to say the least. I had to resort to recursively converting all hashes to arrays. T.