Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Hashtbls with physical equality?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-11-15 (21:30)
From: Marcin 'Qrczak' Kowalczyk <qrczak@k...>
Subject: Re: [Caml-list] Hashtbls with physical equality?
Brian Hurt <> writes:

> There is no magic value associated with objects, unlike Java.  Personally, 
> I think that was one of the biggest screwups with Java.

Where is it in Java? As far as I know Java does not provide any way
to obtain a unique int corresponding to object identity.

It does provide a default hashCode() which is compatible with the
default equals(), and the default equals() compares pointers, but
hashCode() does not have to be unique. It's still hard to implement
the default hashCode() with a copying GC (with a usable distribution
and without overheads).

   __("<         Marcin Kowalczyk