caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] How OCaml objects of sum types can be passed to a C/C++ functions?
@ 2004-07-07  8:56 Claudio Trento
  2004-07-07  9:24 ` Richard Jones
  2004-07-07  9:29 ` Basile Starynkevitch [local]
  0 siblings, 2 replies; 3+ messages in thread
From: Claudio Trento @ 2004-07-07  8:56 UTC (permalink / raw)
  To: caml-list


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-07  9:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-07  8:56 [Caml-list] How OCaml objects of sum types can be passed to a C/C++ functions? Claudio Trento
2004-07-07  9:24 ` Richard Jones
2004-07-07  9:29 ` Basile Starynkevitch [local]

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).