caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Attributes for free
@ 2006-09-26  3:29 David Baelde
  0 siblings, 0 replies; only message in thread
From: David Baelde @ 2006-09-26  3:29 UTC (permalink / raw)
  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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-26  3:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-26  3:29 Attributes for free David Baelde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).