From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA06238; Fri, 27 Aug 2004 20:25:13 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA05866 for ; Fri, 27 Aug 2004 20:25:12 +0200 (MET DST) Received: from quincy.inria.fr (quincy.inria.fr [128.93.8.52]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i7RIOg5J012196; Fri, 27 Aug 2004 20:24:42 +0200 Received: by quincy.inria.fr (Postfix, from userid 23861) id E80AD11C6A5; Fri, 27 Aug 2004 20:24:41 +0200 (CEST) Date: Fri, 27 Aug 2004 20:24:41 +0200 From: Michel Mauny To: Richard Jones Cc: caml-list@inria.fr Subject: Re: [Caml-list] pa_macro to substitute a constant? Message-ID: <20040827182441.GB19658@quincy.inria.fr> Reply-To: Michel.Mauny@inria.fr References: <20040827163232.GB29127@annexia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20040827163232.GB29127@annexia.org> User-Agent: Mutt/1.4.1i X-Miltered: at nez-perce with ID 412F7C6A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 ocamlc:01 camlp:01 -pp:01 uident:01 pcaml:01 uident:01 ifdef:01 cmo:01 ocaml:01 ecrivait:02 string:03 string:03 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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)) " 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