Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@l...>
Subject: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys

skaller writes:
 > 
 > The problem is that the Ocaml hashtbl isn't a conventional
 > hash table. It allows multiple bindings which means it
 > cannot be treated as a simple container.

It's  probably done  on  purpose.  Indeed, it  is  very convenient  to
implement symbol tables --- in an imperative way --- because with this
semantics for Hashtbl.add a new  binding really hides any previous one
until the end of its  scope where Hashtbl.remove restores the previous
binding.

This has nothing to do with Ocaml; I'm pretty sure you can find C hash
tables implementations with the same feature.

-- 
Jean-Christophe

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners