Version française
Home     About     Download     Resources     Contact us    
Browse thread
symbol managment in Caml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stephan Houben <stephan@p...>
Subject: symbol managment in Caml
Hello list,

I am writing an interpreter for a simple language in O'Caml.
The interpreter often needs to search a hash table with a string
as key. A common optimization for this is to use pointer identity
instead of string equality, and "intern" every string before using
it as a key to the hash table.

Unfortunately, I don't see how to do this with the current O'Caml
libs. You can do identity checks with ==, but there seems no way
to get a good hash corresponding to ==.

Has anyone already written some code for this task?

Thanks in advance,

Stephan