<div dir="ltr"><div><div><div>An one of simplest methods will be to use <br>Callback.register name callback_func<br></div>on OCaml side and to use something like:<br>closure_f = caml_named_value(name);</div><div>ml_reply = caml_callback(*closure_f, ml_arg);<br></div>on C side.<br><br></div>WBR, ssp<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-12-28 18:05 GMT+05:00 john skaller <span dir="ltr"><<a href="mailto:skaller@internode.on.net" target="_blank">skaller@internode.on.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There’s some machinery for this but .. well I am suspicious :)<br>
<br>
How can this possibly work?<br>
<br>
Caml functions are closures,  the only way you could pass<br>
a closure would be to generate a thunk. I’m suspicious that<br>
this doesn’t work in general. And you would need to find<br>
a place to put the thunk which the OS allows you to execute.<br>
<br>
—<br>
john skaller<br>
<a href="mailto:skaller@users.sourceforge.net">skaller@users.sourceforge.net</a><br>
<a href="http://felix-lang.org" rel="noreferrer" target="_blank">http://felix-lang.org</a><br>
<br>
______________________________<wbr>_________________<br>
Ctypes mailing list<br>
<a href="mailto:Ctypes@lists.ocaml.org">Ctypes@lists.ocaml.org</a><br>
<a href="http://lists.ocaml.org/listinfo/ctypes" rel="noreferrer" target="_blank">http://lists.ocaml.org/<wbr>listinfo/ctypes</a><br>
</blockquote></div><br></div>