[MLton] feature request: hash function for Pointer.t

John Reppy jhr at cs.uchicago.edu
Sun Dec 6 09:31:22 PST 2009


Because MLton doesn't provide a way to dynamically define callbacks, I need to manage
the a mapping from C pointers to ML functions.  I'd like to use a hash table to do
this, but there isn't an easy way to compute hash keys from pointers.  I'd like
to see a function

	val hash : t -> word

added to the MLTON_POINTER signature.

As a more long-term request, it would be nice to have something like the GHC notion
of stable pointers that would allow ML values to be passed to C code for later supply
as arguments to callbacks.

	- John




More information about the MLton mailing list