caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <damien.doligez@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] adding an ocaml interpreter to my C program
Date: Wed, 7 Jan 2004 17:51:51 +0100	[thread overview]
Message-ID: <CAD3D49F-4131-11D8-BEFF-00039310CAE8@inria.fr> (raw)
In-Reply-To: <20040107160452.GA22783@redhat.com>

> Actually, perhaps I didn't describe it too well, but the OCaml case is
> probably quite a bit simpler than Perl.  What would be really nice for
> OCaml would be some way to have all the identifiers properly prefixed,
> eg. with caml_ and CAML_.  Even if was an optional
> -DCAML_CLEAN_SYMBOLS or something, that would be a huge help.

Just check out the CVS version.  I spent some of my Christmas holidays
implementing exactly that.

Every global symbol exported by the runtime system now starts with
"caml_", with the only exception of "main", and every global symbol
produced by ocamlopt now starts with "caml".

The change is transparent: any C source that interfaces with OCaml
still works as before, thanks to a bunch of #defines in a new
header file (compatibility.h), which is included from the other
caml header files.  In your code that uses the new names directly,
you can #define CAML_NAME_SPACE before including the header files,
and then compatibility.h is not included.

I may have broken some of the native-code ports in the process,
so if you have one of the more exotic architectures, please try
the CVS version and report any problems you find.  It was tested
on PPC/MacOSX, i386/Linux, alpha/Tru64Unix, and IA64 (I don't know
which OS).

We still need to do it to the pieces of C code in otherlibs.

We haven't done it for the macros, because name space pollution
is much less problematic at that level.

-- Damien

-------------------
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-01-07 16:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-07  9:01 Kip Macy
2004-01-07 13:00 ` Richard Jones
2004-01-07 15:42   ` Kip Macy
2004-01-07 16:04     ` Richard Jones
2004-01-07 16:51       ` Damien Doligez [this message]
2004-01-07 21:09   ` Kip Macy
2004-01-08 16:40     ` Adolf Mathias

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=CAD3D49F-4131-11D8-BEFF-00039310CAE8@inria.fr \
    --to=damien.doligez@inria.fr \
    --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).