Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] CamlIDL question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] CamlIDL question
> Is the below trick is possible in CamlIDL?
> I want to wrap C library that uses structs for storing
> pointers to functions

No, CamlIDL doesn't support C function pointers.  The reason is that
mapping C functions pointers to Caml functions is easy, but mapping
Caml function closures to C functions is nearly impossible (there is
nowhere to store and pass the environment part of the closure).

However, CamlIDL support COM interfaces, which are basically a subset
of C++ classes.  These support two-way conversions between OCaml
objects (i.e. more or less collections of Caml functions) and COM objects
(i.e. more or less collections of C function pointers + instance

- Xavier Leroy
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: