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 JAA31882; Sat, 19 Jun 2004 09:27:58 +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 JAA31886 for ; Sat, 19 Jun 2004 09:27:57 +0200 (MET DST) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5J7RtSH023788 for ; Sat, 19 Jun 2004 09:27:56 +0200 Received: (qmail 12694 invoked from network); 19 Jun 2004 07:27:54 -0000 Received: from dsl081-145-152.chi1.dsl.speakeasy.net (HELO firebird) ([64.81.145.152]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 19 Jun 2004 07:27:54 -0000 Date: Sat, 19 Jun 2004 02:29:31 -0500 From: art yerkes To: Gu Nu Cc: caml-list@inria.fr Subject: Re: [Caml-list] Interface between Ocaml and C++ Message-Id: <20040619022931.17b48975.ayerkes@speakeasy.net> In-Reply-To: <20040619045605.16162.qmail@web60908.mail.yahoo.com> References: <20040619045605.16162.qmail@web60908.mail.yahoo.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40D3EAFB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; yerkes:01 ayerkes:01 caml-list:01 2004:99 vectors:01 swig:01 swig:01 ocaml:01 ocaml:01 speakeasy:01 interfaces:01 module:03 classes:03 classes:03 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 18 Jun 2004 21:56:05 -0700 (PDT) Gu Nu wrote: > Hi, all > > Does anybody know how to deal with C++ classes, such > as vectors, maps, in Ocaml? It seems that currently > Ocaml can only support the interoperation of C. So > the first step is to try encapusuate a C++ class with > C interface, then write C interface for Ocaml. > However, it is so inconvient for std classes. Does > anybody has any better ideas? > > Thanks a lot! > > Andy > The SWIG module for Ocaml has support for a few STL types. If you use those interfaces as a guide, you could add support for more if the automatic wrapping doesn't suit. SWIG isn't perfect for everyone but some needs are met very well, including using templates. Look at http://www.swig.org/ -- Hey, Adam Smith, keep your invisible hands to yourself! ------------------- 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