Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Attributes for free

0 views
Skip to first unread message

David Baelde

unread,
Sep 25, 2006, 11:31:48 PM9/25/06
to Ocaml
Hi,

I have a lambda-term representation, which is used in intensive
computations. I'd like to attach some attributes to some of these
terms, like naming hints for abstracted variables, parsing or typing
information. This information wouldn't be accessed very often,
typically not in my intensive computations.

I could of course extend my datatype to do that. But (1) it takes a
non-trivial modification of the code in several of my modules (2)
making the term representation heavier might make my computations
slower. Thus, I'm looking for an other solution.

I could use some hash table. The problem is that it doesn't play well
with GC: if I release some term, the GC might not be able to erase it
if it's referenced in the table, and it won't be able to erase the
associated attributes either.

Any idea ? I don't know much about weak hashtables, I especially have
no idea about the erasing strategy. Could it help ?

Thanks for any advice.
--
David

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

0 new messages