Hello,
I have had the same problem and I was about to write the
new function when I stopped: the time taken by the hash
function was not worth the extra coding.
But I think that it's really a great pity that the
standard library lacks such a function. Moreover, it
should be really easy to implement it. Could we expect
it implemented?
Cheers,
C.S.C.
On Fri, Feb 25, 2000 at 13:16:22 +0100, Stephan Houben wrote:
> 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
-- ----------------------------------------- Real Name: Claudio Sacerdoti Coen Address: via del Colle n.6 S. Lazzaro di Savena (BO) Italy e-mail: sacerdot@cs.unibo.it -----------------------------------------
This archive was generated by hypermail 2b29 : Fri Feb 25 2000 - 20:02:04 MET