From: ts Date: 2002-03-14T00:27:24+09:00 Subject: Re: key comparision inside Hash >>>>> "E" == Erik =?ISO-8859-1?Q?B=E5gfors?= writes: E> What's the best way to create such a hash-method btw?? One way (and *not* the best) is to use XOR (or ADD). Something like this class A attr_reader :a, :b def initialize(a, b) @a, @b = a, b end def hash @a.hash ^ @b.hash end def eql?(o) o.kind_of?(A) && @a.eql?(o.a) && @b.eql?(o.b) end end but you'll have A.new(a, b).hash == A.new(b, a).hash Guy Decoux