From: Alessandro Baretta <alex@baretta.com>
To: Ocaml <caml-list@inria.fr>, Caml bugs <caml-bugs@pauillac.inria.fr>
Subject: [Caml-list] Bug or feature?
Date: Fri, 07 Mar 2003 00:18:29 +0100 [thread overview]
Message-ID: <3E67D745.70807@baretta.com> (raw)
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
next reply other threads:[~2003-03-06 23:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-06 23:18 Alessandro Baretta [this message]
2003-03-06 23:43 ` Remi Vanicat
2003-03-06 23:56 ` Alessandro Baretta
2011-09-12 12:56 Andrej Bauer
2011-09-12 13:13 ` Jesper Louis Andersen
2011-09-12 13:19 ` Philippe Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E67D745.70807@baretta.com \
--to=alex@baretta.com \
--cc=caml-bugs@pauillac.inria.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox