[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: m4_quote [was: fix AT_SETUP's sh-escaping]
From: |
Eric Blake |
Subject: |
Re: m4_quote [was: fix AT_SETUP's sh-escaping] |
Date: |
Thu, 26 Oct 2006 06:29:18 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Joel E. Denny on 10/26/2006 12:14 AM:
>
> I just did this experiment, which for me is clearer than either above
> example:
>
> $ cat example.m4
> m4_divert(0)dnl
> m4_define([mkargs],[1,2,3])
> m4_define([echo_arg1],[[$1]])
> echo_arg1(mkargs)
> echo_arg1([mkargs])
> echo_arg1(m4_quote(mkargs))
> echo_arg1(m4_dquote(mkargs))
> $ autom4te -l m4sugar example.m4
> 1
> mkargs
> 1,2,3
> [1],[2],[3]
>
> I wonder if this could be added to the autoconf manual.
>
Sounds good to me. How about this patch?
2006-10-26 Eric Blake <address@hidden>
* THANKS: Update.
* doc/autoconf.texi (Evaluation Macros): Improve the example to
show effect on macros that expand with commas.
Reported by Joel E. Denny.
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFQKoe84KuGfSFAYARAkMSAKDWStEcXaNFjOterLYxfBkZ4ueXfACfTDHD
BikoajIsHteCbOtSfTrmTGA=
=6/mh
-----END PGP SIGNATURE-----
Index: doc/autoconf.texi
===================================================================
RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1101
diff -u -p -r1.1101 autoconf.texi
--- doc/autoconf.texi 25 Oct 2006 20:21:05 -0000 1.1101
+++ doc/autoconf.texi 26 Oct 2006 12:28:48 -0000
@@ -9921,14 +9921,24 @@ using these macros, (ii), using @code{m4
$ @kbd{cat example.m4}
# Overquote, so that quotes are visible.
m4_define([show], [$[]1 = [$1], $[]@@ = [$@@]])
+m4_define([mkargs], [1, 2, 3])
+m4_define([arg1], [[$1]])
m4_divert(0)dnl
show(a, b)
show(m4_quote(a, b))
show(m4_dquote(a, b))
+arg1(mkargs)
+arg1([mkargs])
+arg1(m4_quote(mkargs))
+arg1(m4_dquote(mkargs))
$ @kbd{autom4te -l m4sugar example.m4}
$1 = a, $@@ = [a],[b]
$1 = a,b, $@@ = [a,b]
$1 = [a],[b], $@@ = [[a],[b]]
+1
+mkargs
+1,2,3
+[1],[2],[3]
@end example
- Re: fix AT_SETUP's sh-escaping, Joel E. Denny, 2006/10/22
- Message not available
- Message not available
- Re: fix AT_SETUP's sh-escaping, Paul Eggert, 2006/10/23
- Re: fix AT_SETUP's sh-escaping, Joel E. Denny, 2006/10/25
- m4_quote [was: fix AT_SETUP's sh-escaping], Eric Blake, 2006/10/25
- Re: m4_quote [was: fix AT_SETUP's sh-escaping], Joel E. Denny, 2006/10/26
- Re: m4_quote [was: fix AT_SETUP's sh-escaping],
Eric Blake <=
- Re: m4_quote, Paul Eggert, 2006/10/26
- Re: m4_quote, Joel E. Denny, 2006/10/26
- Re: m4_quote, Eric Blake, 2006/10/26
- Re: fix AT_SETUP's sh-escaping, Stepan Kasal, 2006/10/25
- Re: fix AT_SETUP's sh-escaping, Paul Eggert, 2006/10/25
- Re: fix AT_SETUP's sh-escaping, Joel E. Denny, 2006/10/26
- Re: fix AT_SETUP's sh-escaping, Stepan Kasal, 2006/10/26
- Re: fix AT_SETUP's sh-escaping, Joel E. Denny, 2006/10/26
- Re: fix AT_SETUP's sh-escaping, Eric Blake, 2006/10/26
- Re: fix AT_SETUP's sh-escaping, Joel E. Denny, 2006/10/26