caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <jacques.garrigue@gmail.com>
To: Joel Reymont <joelr1@gmail.com>, caml-list@yquem.inria.fr
Subject: RE: [Caml-list] c++ class to ocaml class or module?
Date: Wed, 29 Dec 2010 08:15:15 +0900	[thread overview]
Message-ID: <-7059986755517193363@unknownmsgid> (raw)

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

             reply	other threads:[~2010-12-28 23:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-28 23:15 Jacques Garrigue [this message]
2010-12-28 23:26 ` Joel Reymont
2010-12-29  0:11   ` Jacques Garrigue
  -- strict thread matches above, loose matches on Subject: below --
2010-12-28 21:34 Joel Reymont

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=-7059986755517193363@unknownmsgid \
    --to=jacques.garrigue@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=joelr1@gmail.com \
    /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).