Hi,
I am not sure if a future version of GNU m4 intends to become compliant
with POSIX in the matter of defn() with multiple arguments.
However, I think the following example motivates this feature, should
you in fact have need of motivation.
In my application, I build up program text in macros; more exactly, I
build up nested `foreach()' loops when expanding macros. Each input
line consists of a single macro invocation, each such line adds a level
of nesting to the resulting program text, which is expanded when a
section of such lines has been read. The program text is held in
certain macros, such as LOOP_BEGIN, LOOP_END, LOOP_BODY, etc., which are
concatenated at the end of a section. (As an aside, these macros
typically have an unbalanced set of quotes and require local changes to
the quote characters to be processed correctly.)
Anyhow, my code for concatenating/rereading/executing the resultant
program text currently looks like this:
define(`ALL', changequote([,])defn(LOOP_BEGIN)[]defn(
LOOP_BODY)[]defn(LOOP_END)changequote(`,'))ALL
The local change of quotes is required because the different loop parts
have unbalanced quotes. My hope would be that with a multiple-argument
defn(), this could be simplified to:
define(`ALL', defn(`LOOP_BEGIN', `LOOP_BODY', `LOOP_END'))ALL
In other words, that defn() be implemented to concatenate its arguments
first, then to quote the resulting string as a whole.
Regards,
Konrad Schwarz
BEGIN:VCARD
VERSION:2.1
N:Schwarz;Konrad
FN:Konrad Schwarz
ORG:Siemens AG;CT SE 2
TITLE:Principal Engineer
TEL;WORK;VOICE:+49 (89) 636-53579
TEL;WORK;FAX:+49 (89) 636-45450
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;53 518;Siemens AG=0D=0ACT SE 2;M=FCnchen;;81730;Germany
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:53 518=0D=0ASiemens AG=0D=0ACT SE 2=0D=0AM=FCnchen 81730=0D=0AGermany
ADR;POSTAL;ENCODING=QUOTED-PRINTABLE:;;Siemens AG=0D=0ACT SE 2;M=FCnchen;;81730;Germany
LABEL;POSTAL;ENCODING=QUOTED-PRINTABLE:Siemens AG=0D=0ACT SE 2=0D=0AM=FCnchen 81730=0D=0AGermany
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20060130T101011Z
END:VCARD
_______________________________________________
Bug-m4 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-m4