caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Loup Vaillant" <loup.vaillant@gmail.com>
To: "Caml List" <caml-list@inria.fr>
Subject: A macro system compatible with modules
Date: Wed, 20 Jun 2007 14:17:22 +0200	[thread overview]
Message-ID: <6f9f8f4a0706200517h17e550f9na83bb2ed97f3749d@mail.gmail.com> (raw)

Hello,

I would like to define a macro system (like #define) which satisfy the
following constraints :

-> When I define a macro, it is available for use right now, in the
same compilation unit.
-> If I want to call the macro from another compilation unit, I just
have to either open the corresponding module :

open My_comp_unit;;
(* some code *)
my_macro (* macro arguments *)

or access the macro through indirection :

My_comp_unit.my_macro (* macro arguments *)

-> [optional] a macro must declared in the .mli file to be accessible
from the outside, and is automatically accessible if this .mli file is
not defined by the author of the compilation unit.
-> [optional] do the same things for any module (defined as is, or
from a functor)

This would be ideal for avoiding namespaces issues.

What about plain camlp4 macros?
What about the #define defined in camlp4?
Is such a a thing possible?
To what extent?

Thanks,
Loup Vaillant

(reminder
  my ultimate goal is Lisp-like macros)


             reply	other threads:[~2007-06-20 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-20 12:17 Loup Vaillant [this message]
2007-06-20 12:52 ` [Caml-list] " Pietro Abate

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=6f9f8f4a0706200517h17e550f9na83bb2ed97f3749d@mail.gmail.com \
    --to=loup.vaillant@gmail.com \
    --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).