]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sugar.m4 (_m4_map): New macro.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 5 Oct 2005 21:27:43 +0000 (21:27 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 5 Oct 2005 21:27:43 +0000 (21:27 +0000)
(m4_map, m4_map_sep): Use it.  Handle the empty list correctly.

ChangeLog
lib/m4sugar/m4sugar.m4

index 0c603328cc37f2160f40a3d9df3ad4bbe6bb6757..29de880bab8df5f288f4825b8a2d9ed532f28adb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/m4sugar/m4sugar.m4 (_m4_map): New macro.
+       (m4_map, m4_map_sep): Use it.  Handle the empty list correctly.
+
 2005-10-04  Stepan Kasal  <kasal@ucw.cz>
 
        * lib/autotest/general.m4 (AT_INIT): Really make the subtree writable
index 706a3a5f1b586aa04f3ca0a1a98d8131cb619281..ad184c25f3dc648a167881f4218b3a73bd555522 100644 (file)
@@ -398,8 +398,11 @@ m4_define([m4_cdr],
 # of LIST (which can be lists themselves, for multiple arguments MACROs).
 m4_define([m4_fst], [$1])
 m4_define([m4_map],
+[m4_if([$2], [[]], [],
+       [_m4_map([$1], [$2])])])
+m4_define([_m4_map],
 [m4_ifval([$2],
-         [$1(m4_fst($2))[]m4_map([$1], m4_cdr($2))])])
+         [$1(m4_fst($2))[]_m4_map([$1], m4_cdr($2))])])
 
 
 # m4_map_sep(MACRO, SEPARATOR, LIST)
@@ -408,8 +411,8 @@ m4_define([m4_map],
 # are the elements of LIST (which can be lists themselves, for multiple
 # arguments MACROs).
 m4_define([m4_map_sep],
-[m4_ifval([$3],
-         [$1(m4_fst($3))[]m4_map([$2[]$1], m4_cdr($3))])])
+[m4_if([$3], [[]], [],
+       [$1(m4_fst($3))[]_m4_map([$2[]$1], m4_cdr($3))])])
 
 
 ## ---------------------------------------- ##