[MLton] Exporting closures to C code

Jens Axel Søgaard jensaxel@soegaard.net
Sun, 25 Sep 2005 22:13:13 +0200


Florian Weimer wrote:
> Most C libraries which use callback functions provide some means to
> pass a user-supplied pointer to the callback function.  This could be
> used to invoke MLton functions from C code (passing the closure
> explicitly), even if these functions are not exported.
> 
> How hard would that be to implement?

Perhaps you could simply pass a pointer to Cfunc?
Here Cfunc is described in:

<http://mlton.org/pipermail/mlton/2005-September/028052.html>

-- 
Jens Axel Søgaard