caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Claudio Trento <trento@di.unipi.it>
To: caml-list@inria.fr
Subject: [Caml-list] How OCaml objects of sum types can be passed to a C/C++ functions?
Date: Wed, 7 Jul 2004 10:56:04 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0407071047060.15731-100000@strudel.di.unipi.it> (raw)


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


             reply	other threads:[~2004-07-07  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-07  8:56 Claudio Trento [this message]
2004-07-07  9:24 ` Richard Jones
2004-07-07  9:29 ` Basile Starynkevitch [local]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0407071047060.15731-100000@strudel.di.unipi.it \
    --to=trento@di.unipi.it \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).