Rick Denatale wrote:
>   def hash
>     to_a.sort.hash
>   end

This requires the hash key and value to implement <=> which will not be 
always the case and thus breaks.

>   def hash
>     1
>   end
> ...
> but I'm not sure that mapping the hash value to a
> constant is a good idea.

I'm sure it is not. That way every Hash as key is stored in the same 
bucket, essentially making it no different from an Array in the way keys 
are looked up (only advantage is, that you don't have the method call 
overhead you'd have with an Array solution).

Regards
Stefan
-- 
Posted via http://www.ruby-forum.com/.