From: Brian Candler Date: 2007-05-09T01:55:14+09:00 Subject: Re: Equality question On Wed, May 09, 2007 at 12:58:01AM +0900, Sebastian Hungerecker wrote: > Brian Candler wrote: > > o1 = [:defuzz_configs, {"conf"=>"foo.txt"}] > > o2 = [:defuzz_configs, {"conf"=>"foo.txt"}] > > p o1 == o2 # prints true > > p o1.hash == o2.hash # prints false ?? <<<<<<<<<<< > > That's because the Hashs in o1 and o2 are two different objects. So hashes and arrays don't behave the same in this regard? o1 = ["hello", ["world"]] o2 = ["hello", ["world"]] p o1 == o2 p o1.hash == o2.hash # prints true o1 = {"key"=>"hello"} o2 = {"key"=>"hello"} p o1 == o2 p o1.hash == o2.hash # prints false I wonder why this is?