Werner,

I would say that you are right, this is a problem. A (not un-common) source of 
subtle bugs in Smalltalk is missing this rule that equivalent objects must have 
the same hash. In GemStone the objects are not equivalent (I’m not arguing that 
this is right, just that it avoids the problem you identify).

I wonder what would happen if the hash comparison were added to the equivalence 
operator (#’=‘)!

James

> On Jul 30, 2018, at 5:07 AM, werner kassens <wkass...@libello.com> wrote:
> 
> Hi,
> i guess i can subsume almost everything i know about hashes in one sentence:
> it is my understanding that two objects that are equal (obj1=obj2.
> -->true) have to have the same hash value (which is used for some
> collection types), whereas objects where obj1=obj2 returns false should
> have different hash values although it may happen that they have the
> same one.
> 
> now here things don't turn out exactly like that:
> (1 to:4) = #(1 2 3 4). "true"
> (1 to:4)hash = #(1 2 3 4)hash. "false"
> well ok, actually these results make - pfffh, in a certain way - sense
> to me, but i wonder what arguments the people in the know would use to
> defend that result, if i would have another opinion?
> werner
> 
> 
> 


Reply via email to