caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] c++ class to ocaml class or module?
@ 2010-12-28 21:34 Joel Reymont
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Reymont @ 2010-12-28 21:34 UTC (permalink / raw)
  To: caml-list

Would you suggest wrapping a C++ class in a class in OCaml?

Should I pick another approach, e.g. using a module?

	Thanks, Joel

---
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont






^ permalink raw reply	[flat|nested] 4+ messages in thread
* RE: [Caml-list] c++ class to ocaml class or module?
@ 2010-12-28 23:15 Jacques Garrigue
  2010-12-28 23:26 ` Joel Reymont
  0 siblings, 1 reply; 4+ messages in thread
From: Jacques Garrigue @ 2010-12-28 23:15 UTC (permalink / raw)
  To: Joel Reymont, caml-list

From: Joel Reymont <joelr1@gmail.com>

>Would you suggest wrapping a C++ class in a class in OCaml?
>
>Should I pick another approach, e.g. using a module?

In C++ classes act both as object generators and modularity providers.
So you should first determine what is the role of the class you're wrapping.

Note also that since the FFI cannot directly create ocaml objects, you
will first need to wrap methods as external functions anyway.
I would only suggest making the extra effort of combining these
functions into classes if sutyping is actively used.

Jacques Garrigue

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

end of thread, other threads:[~2010-12-29  0:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-28 21:34 [Caml-list] c++ class to ocaml class or module? Joel Reymont
2010-12-28 23:15 Jacques Garrigue
2010-12-28 23:26 ` Joel Reymont
2010-12-29  0:11   ` Jacques Garrigue

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