caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <xavier.leroy@inria.fr>
To: "Yurii A. Rashkovskii" <yrashk@openeas.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] CamlIDL question
Date: Sun, 13 Oct 2002 10:48:25 +0200	[thread overview]
Message-ID: <20021013104825.H13771@pauillac.inria.fr> (raw)
In-Reply-To: <20021007140248.GA22632@rashko.ilt.kharkov.ua>; from yrashk@openeas.org on Mon, Oct 07, 2002 at 05:02:48PM +0300

> Is the below trick is possible in CamlIDL?
> I want to wrap C library that uses structs for storing
> pointers to functions

No, CamlIDL doesn't support C function pointers.  The reason is that
mapping C functions pointers to Caml functions is easy, but mapping
Caml function closures to C functions is nearly impossible (there is
nowhere to store and pass the environment part of the closure).

However, CamlIDL support COM interfaces, which are basically a subset
of C++ classes.  These support two-way conversions between OCaml
objects (i.e. more or less collections of Caml functions) and COM objects
(i.e. more or less collections of C function pointers + instance
variables).

- Xavier Leroy
-------------------
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:[~2002-10-13  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-07 14:02 Yurii A. Rashkovskii
2002-10-13  8:48 ` Xavier Leroy [this message]
2002-10-13 17:10   ` Dmitry Bely
2002-10-13 23:12     ` Chris Hecker
2005-10-25 22:26 Christian Stork
2005-10-26  5:03 ` [Caml-list] " Igor Pechtchanski
2005-10-26 11:11   ` Christian Stork

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=20021013104825.H13771@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=yrashk@openeas.org \
    /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).