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
Re: [Caml-list] possible to define a type where = is forbidden ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-10-11 (14:56)
From: Thomas Fischbacher <Thomas.Fischbacher@P...>
Subject: EQ hash tables?

On Mon, 10 Oct 2005, Thomas Fischbacher wrote:

> When you want to associate extra data to stuff that should retain nice 
> comparison properties, another technique which might be useful or not is 
> to use a weak pointer hash, mapping subtrees to positions.

Actually, this brings me to a question I wanted to ask for a long time: 
while I never used this so far, I just assumed that OCaml does provide 
hash tables where keys are compared w.r.t. "being the same" ('==' , that 
is), rather than only hash tables where keys are compared for "being 
equal" (say, '=').

Of course, "EQ hash tables" have to be treated in a slightly special way 
when talking about stop&copy GCing. 

So, do they really exist, or don't they?

regards,                   (o_
 Thomas Fischbacher -  //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y)           V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1))                  (Debian GNU)