From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id AB9D9BB83 for ; Mon, 14 Aug 2006 09:17:15 +0200 (CEST) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by nez-perce.inria.fr (8.13.6/8.13.6) with SMTP id k7E7HFC8007059 for ; Mon, 14 Aug 2006 09:17:15 +0200 Received: (qmail 8232 invoked by uid 0); 14 Aug 2006 07:17:15 -0000 Received: from 194.25.187.120 by www113.gmx.net with HTTP; Mon, 14 Aug 2006 09:17:15 +0200 (CEST) Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset="iso-8859-1" Date: Mon, 14 Aug 2006 09:17:15 +0200 From: "Michael Wohlwend" In-Reply-To: <20060814.092046.03363783.garrigue@math.nagoya-u.ac.jp> Message-ID: <20060814071715.183780@gmx.net> MIME-Version: 1.0 References: <20060813224715.0769efc9@localhost> <20060814.092046.03363783.garrigue@math.nagoya-u.ac.jp> Subject: Re: [Caml-list] question about how to bind c++ classes to ocaml To: Jacques Garrigue X-Authenticated: #20477425 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce with ID 44E0237B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 cheers:01 gtk:01 2006:98 ihrer:98 isdn:98 caml-list:01 caml-list:01 functions:01 functions:01 70%:98 binding:02 external:02 string:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 -------- Original-Nachricht -------- Datum: Mon, 14 Aug 2006 09:20:46 +0900 (JST) Von: Jacques Garrigue An: micha-1@fantasymail.de Betreff: Re: [Caml-list] question about how to bind c++ classes to ocaml > Calls from ocaml to C are very cheap. If your access function doesn't > do any allocation (i.e. never calls the GC), you can even make it > faster by marking it as "noalloc". Beware many functions do > allocate, including copy_double or copy_string. thanks for pointing this out. The "noalloc"-thing isn't really described in the docu? :-) Another question which came up was: you can only declare normal functions (not methods) as "external", so you have to write a c function for every c++ member function. Do you rebuild the inheritance hierachy somehow through the type system (maybe with those mysterious phantom types?) or just put an ocaml class system on top of it? cheers Michael ps: I know there is the gtk binding, but understanding the complete source is... not that easy :-) -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer