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.

WBR, ssp

2017-12-28 18:05 GMT+05:00 john skaller <[email protected]>:

> 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
> [email protected]
> http://felix-lang.org
>
> _______________________________________________
> Ctypes mailing list
> [email protected]
> http://lists.ocaml.org/listinfo/ctypes
>
_______________________________________________
Ctypes mailing list
[email protected]
http://lists.ocaml.org/listinfo/ctypes

Reply via email to