From: Aaron Patterson Date: 2007-11-24T16:25:54+09:00 Subject: Re: Hashes, Sets, and eql? On Sat, Nov 24, 2007 at 03:55:00PM +0900, MonkeeSage wrote: > Hi Aaron, > > Set#eql? is probably just Object#eql?, which, as I understand it would > compare the actual objects (not their contents). What you want is a > "shallow" comparison (==). Nope. I don't want a shallow comparison. I need to use my sets as hash keys, so I need .eql? and .hash. Set calls eql? on the internal hash object. From the set source: def hash # :nodoc: @hash.hash end def eql?(o) # :nodoc: return false unless o.is_a?(Set) @hash.eql?(o.instance_eval{@hash}) end -- Aaron Patterson http://tenderlovemaking.com/