English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 <bhurt@spnz.org> 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
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/