Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Michel Mauny <Michel.Mauny@inria.fr>
To: Richard Jones <rich@annexia.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] pa_macro to substitute a constant?
Date: Fri, 27 Aug 2004 20:24:41 +0200	[thread overview]
Message-ID: <20040827182441.GB19658@quincy.inria.fr> (raw)
In-Reply-To: <20040827163232.GB29127@annexia.org>

Richard Jones wrote/écrivait (Fri, Aug 27, 2004 at 05:32:32PM +0100):

> How can I use pa_macro to substitute in a constant into a program?

 > ocamlc -I +camlp4 -pp 'camlp4o pa_macro.cmo -D "PACKAGE="$(PACKAGE)"

> Needless to say this example doesn't work, and looking at the thin
> documentation for pa_macro, I'm not even sure it's possible.  Is it?

I'm afraid not. The "-D" option to pa_macro is followed by an UIDENT,
there is no room for a value for it: in pa_macro.ml, there are two
lines saying

    Pcaml.add_option "-D" (Arg.String (define None))
      "<string> Define for IFDEF instruction."

and the None means "no associated value", here.

However, allowing -D "UIDENT=something" looks like a feature wish I
could try to implement for a future OCaml major release.

-- Michel Mauny

-------------------
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-08-27 18:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-27 16:32 Richard Jones
2004-08-27 18:24 ` Michel Mauny [this message]

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=20040827182441.GB19658@quincy.inria.fr \
    --to=michel.mauny@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=rich@annexia.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