From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A790CBC69 for ; Tue, 2 Oct 2007 06:48:44 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAANZqAUfAXQInemdsb2JhbACONQEBCQo X-IronPort-AV: E=Sophos;i="4.21,219,1188770400"; d="scan'208";a="1981058" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 02 Oct 2007 06:48:44 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l924mhZx001660 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 2 Oct 2007 06:48:44 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAADBqAUdQW+UCh2dsb2JhbACONQEBAQgKJw X-IronPort-AV: E=Sophos;i="4.21,219,1188770400"; d="scan'208";a="17172353" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail4-smtp-sop.national.inria.fr with ESMTP; 02 Oct 2007 06:48:43 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IcZgP-0001Vw-Ld for caml-list@inria.fr; Tue, 02 Oct 2007 04:48:33 +0000 Received: from ivr94-8-88-162-26-239.fbx.proxad.net ([88.162.26.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Oct 2007 04:48:33 +0000 Received: from li by ivr94-8-88-162-26-239.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Oct 2007 04:48:33 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Zheng Li Subject: [ANN] Weaktbl: a weak hash table library Date: Tue, 02 Oct 2007 06:50:30 +0200 Message-ID: <87641q3ysp.fsf@pps.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ivr94-8-88-162-26-239.fbx.proxad.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:iLI3Mb4lrlOp+I0wYG2h1DFdMoU= Sender: news X-Miltered: at concorde with ID 4701CDAB.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; hash:01 hash:01 ocaml:01 functor:01 hashtbl:01 sub-module:01 hashtbl:01 iter:01 cheers:01 pps:01 pps:01 jussieu:01 jussieu:01 conventions:02 data:02 Hi, 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 others. == Description == Weaktbl is yet another weak hash table library for OCaml. Its main features include: * 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.) Link: http://www.pps.jussieu.fr/~li/software/index.html#weaktbl Cheers -- Zheng Li http://www.pps.jussieu.fr/~li