Hi,

In message "[ruby-talk:9533] Strange Hash behavior"
    on 01/01/19, "Agnot Tok" <agnottok / hotmail.com> writes:

|Why does:
|
|class C
|  def initialize(obj)
|    @o = obj
|  end
|  def hash
|    @o.hash
|  end
|  def inspect
|    @o.inspect
|  end
|end
|
|h = {}
|h[C.new(1)] = 1
|h[C.new(1)] = 2
|puts h.inspect
|
|evaluate to {1=>1, 1=>2} and not {1=>2}?
|I thought Hash used the hash method?!

Hash checks equality of keys by `hash' and `eql?'.
Try to define both.

							matz.