[ocaml-ctypes] Passing Caml function to C
ssp.mryau at gmail.com
Thu Dec 28 13:59:46 GMT 2017
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.
2017-12-28 18:05 GMT+05:00 john skaller <skaller at internode.on.net>:
> There’s some machinery for this but .. well I am suspicious :)
> How can this possibly work?
> Caml functions are closures, the only way you could pass
> a closure would be to generate a thunk. I’m suspicious that
> this doesn’t work in general. And you would need to find
> a place to put the thunk which the OS allows you to execute.
> john skaller
> skaller at users.sourceforge.net
> Ctypes mailing list
> Ctypes at lists.ocaml.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ctypes