Hi Jeremy On 08/15/2016 08:34 AM, Jeremy Yallop wrote: > you'd write something like this: > > module Foreign_bindings(F: Cstubs.FOREIGN) = struct > open F > > let mysql_library_init = foreign "mysql_server_init" > (int @-> ptr_opt (ptr char) @-> ptr_opt (ptr char) @-> returning int) > > In this second snippet 'foreign' refers to 'F.foreign', not 'Foreign.foreign'.
In this case a binding that had type "a -> b" now became
(a -> b F.return) F.result
For example, this binding:
let mysql_init = foreign "mysql_init"
(T.mysql_opt @-> returning T.mysql_opt)
had type "T.mysql_opt -> T.mysql_opt" but after the change it became
(T.mysql_opt -> T.mysql_opt F.return) F.result
This way I can't use it as a function anymore. Is this expected?
Thanks,
Andre
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Ctypes mailing list [email protected] http://lists.ocaml.org/listinfo/ctypes
