From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA21060; Fri, 7 Mar 2003 00:13:54 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA20325 for ; Fri, 7 Mar 2003 00:13:53 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from athlon.baretta.com (host174-68.pool80116.interbusiness.it [80.116.68.174]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h26NDp918454 for ; Fri, 7 Mar 2003 00:13:52 +0100 (MET) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id 043A02727F; Fri, 7 Mar 2003 00:18:30 +0100 (CET) Message-ID: <3E67D745.70807@baretta.com> Date: Fri, 07 Mar 2003 00:18:29 +0100 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: it, en MIME-Version: 1.0 To: Ocaml , Caml bugs Subject: [Caml-list] Bug or feature? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; alessandro:01 baretta:01 bug:01 hashtable:01 reclaimed:01 unmarshal:01 hashtbl:01 functor:01 incompatible:01 caml:01 garbage:01 alex:01 marshal:01 signatures:02 modules:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'm not sure whether this is a bug or a feature. I need to save the state of the Xcaml session between CGI executions. Thinking in terms of Jserv-compliant implementation, i used a Weak.Make(...).t hashtable to store session data, so that old and no longer used data might be automatically reclaimed by the GC. However, I found that this implementation is buggy, because when I marshal and unmarshal the weak hashtable, I always get an empty hashtable back. Why is this? I made a switch to Hashtbl.Make(...).t and now the session handling in Xcaml works fine, except that there is no automatic garbage collection. All other code, except for minor modifications due to incompatibilities between the output signatures of Hashtbl.Make and Weak.Make, has been left untouched. One more remark concerning the Weak.Make functor. Why in the world are Hashtbl.Make and Weak.Make incompatible? It is only natural to think of the second as a particularly clever implementation of the first. Besides, the two modules are so similar that really deserve to have the same signatures. I strongly encourage the Caml Masters to think this over. Of course, I could reimplement the Weak.Make functor in a Weak2 module for the ocamllib-addons package, but is it worth it? Alex ------------------- 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