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
[ANN] Weaktbl: a weak hash table library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Zheng Li <li@p...>
Subject: [ANN] Weaktbl: a weak hash table library


I remember weak hash table was discussed on the list not long ago. I once ran
into a situation where weak data structure was desired, and came up with this
small module. Though I didn't really get a chance to make use of it (I turned
to another solution laterly), I'd like to share and hope it would be useful to

== Description ==

Weaktbl is yet another weak hash table library for OCaml. Its main features

 * Both keys and associated values are weakly stored. A binding exists until
   the key is no longer referenced anywhere
 * The implementation is built upon the hash table functor of Weak library
   rather than implemented from scratch, so it's rather small
 * The interface is fully compatible with the standard Hashtbl library instead
   of the hash sub-module of the Weak library, so basically you can also use it
   as an alternative of the standard Hashtbl
 * Its behaviors also follow the standard Hashtbl library's conventions. 
   E.g. the "binding orders" and the "current binding" concepts all make
   sense here (with find/find_all/remove/replace/iter/fold etc.)


Zheng Li