From: matz@... (Yukihiro Matsumoto) Date: 2002-03-15T23:36:44+09:00 Subject: Re: key comparision inside Hash Hi, In message "Re: key comparision inside Hash" on 02/03/15, Vladimir Dozen writes: |> Because the default semantic of "eql?" is equivalence ("equivalence" |> means true iff two objects are same object). | | Mmm. I guess you mean "equivalent", not "same": I meant "same". Two objects need to be same for "eql?" to be true. |> One possible new semantic is that if object is T_OBJECT then "hash" |> and "eql?" test would be based on its class and instance variable |> values. RCR? | | Oops, I fear, I cannot understand it. You express semantics in terms | of realization, right? ;) Ah, yes. It's the easiest language for me to express the behavior. | All I want is that default Object::hash() method return same value for | two objects having same number and names of object member variables, | and same values of those member variables. For simple cases like above | Coord class (where only @x and @y present) it would be enough, for | complex classes programmer will have to write own hash(). | | I guess, it will not break things? That's what I meant in above statement. I can't foresee any problem, but it doesn't mean there will be no problem. matz.