Object ID's

John Cowan cowan at ccil.org
Wed Mar 21 08:45:57 PDT 2007


Igor Bukanov scripsit:

> A side remark about requiring intrinsic::hashcode to be unique. It can
> be extremely expensive to implement that in Rhino since Java does not
> require that Object.hashCode returns unique numbers. From
> http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode()

What's worse, Java encourages class authors to override hashCode,
and there is no basicHashCode method (as in Smalltalk) to retrieve
the approximation-to-object-identity.  (IMHO you ought not to
override equals and hashCode unless your class represents values,
but Java programmers routinely do so.)

-- 
John Cowan   cowan at ccil.org  http://www.ccil.org/~cowan
Most languages are dramatically underdescribed, and at least one is
dramatically overdescribed.  Still other languages are simultaneously
overdescribed and underdescribed.  Welsh pertains to the third category.
        --Alan King



More information about the Es4-discuss mailing list