From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA17201; Sun, 13 Oct 2002 10:48:32 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA17007 for ; Sun, 13 Oct 2002 10:48:31 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9D8mP517846; Sun, 13 Oct 2002 10:48:25 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA17116; Sun, 13 Oct 2002 10:48:25 +0200 (MET DST) Date: Sun, 13 Oct 2002 10:48:25 +0200 From: Xavier Leroy To: "Yurii A. Rashkovskii" Cc: caml-list@inria.fr Subject: Re: [Caml-list] CamlIDL question Message-ID: <20021013104825.H13771@pauillac.inria.fr> References: <20021007140248.GA22632@rashko.ilt.kharkov.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20021007140248.GA22632@rashko.ilt.kharkov.ua>; from yrashk@openeas.org on Mon, Oct 07, 2002 at 05:02:48PM +0300 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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 variables). - Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners