From: Robert Dober Date: 2010-06-11T14:52:14+09:00 Subject: Re: comparing objects On Thu, Jun 10, 2010 at 6:48 PM, Mark Abramov wrote: > Robert Dober wrote: >> On Thu, Jun 10, 2010 at 5:30 PM, Rein Henrichs wrote: >> overwriting #hash and #eql? breaks  Hash! > That's not true, I think. Judge for yourself require "forwardable" def count klass ObjectSpace.each_object( klass ).to_a.size end class N extend Forwardable attr_reader :n def_delegators :n, :hash def eql? otha n == otha.n end private def initialize n @n = n end end # class N h = { N.new( 42 ) => true } h[ N.new( 42 ) ] = 42 p h GC.start p count(N) Cheers R.