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 LAA25203; Wed, 7 Jul 2004 11:10:55 +0200 (MET DST) 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 LAA24678 for ; Wed, 7 Jul 2004 11:10:55 +0200 (MET DST) Received: from mailserver.di.unipi.it (apis.di.unipi.it [131.114.3.6]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i679ArSH015874 for ; Wed, 7 Jul 2004 11:10:54 +0200 Organization: Dipartimento di Informatica Received: from strudel.di.unipi.it (strudel [131.114.3.156]) by mailserver.di.unipi.it (8.11.6/8.11.6) with ESMTP id i678u6s06415 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified NO) for ; Wed, 7 Jul 2004 10:56:06 +0200 Received: from strudel.di.unipi.it (localhost.localdomain [127.0.0.1]) by strudel.di.unipi.it (8.12.8/8.12.8) with ESMTP id i678u5vm016260 for ; Wed, 7 Jul 2004 10:56:05 +0200 Received: from localhost (trento@localhost) by strudel.di.unipi.it (8.12.8/8.12.8/Submit) with ESMTP id i678u455016256 for ; Wed, 7 Jul 2004 10:56:04 +0200 X-Authentication-Warning: strudel.di.unipi.it: trento owned process doing -bs Date: Wed, 7 Jul 2004 10:56:04 +0200 (CEST) From: Claudio Trento To: caml-list@inria.fr Subject: [Caml-list] How OCaml objects of sum types can be passed to a C/C++ functions? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner-Information: Please contact the ISP for more information X-MailScanner: Found to be clean X-MailScanner-SpamCheck: non spam, SpamAssassin (punteggio=-4.9, necessario 5, BAYES_00 -4.90) X-Miltered: at concorde with ID 40EBBE1D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; trento:99 trento:99 interfacing:01 expr:01 expr:01 uminus:01 ocaml:01 ocaml:01 int:01 int:01 objects:02 objects:02 suppose:03 variable:03 object:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk on the subject of interfacing OCaml with C/C++, it is not clear to me whether and how OCaml objects of sum types can be passed to a C/C++ function. For example, suppose I have the declaration type expr = Variable of int | Coefficient of int | UPlus of expr | UMinus of expr | Sum of (expr * expr) | Difference of (expr * expr) | Product of (expr * expr) What is the best way to pass an expr object to C/C++? How can C/C++ code visit such a structure? Many thanks for your time and patience, Claudio ------------------- 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