Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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/