[ocaml-ctypes] Passing Caml function to C

john skaller skaller at internode.on.net
Thu Dec 28 14:15:14 GMT 2017

> On 29 Dec. 2017, at 00:59, Serge Sivkov <ssp.mryau at gmail.com> wrote:
> An one of simplest methods will be to use 
> Callback.register name callback_func
> on OCaml side and to use something like:
> closure_f = caml_named_value(name);
> ml_reply = caml_callback(*closure_f, ml_arg);
> on C side.

So the user supplied name is used to associate the code
and data across the boundary?

john skaller
skaller at users.sourceforge.net

More information about the Ctypes mailing list