* lib/m4sugar/m4sugar.m4 (m4_map_sep): New.

This commit is contained in:
Akim Demaille 2002-05-03 08:26:29 +00:00
parent 8f8b3c874a
commit 89dd0d23ad
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2002-05-03 Akim Demaille <akim@epita.fr>
* lib/m4sugar/m4sugar.m4 (m4_map_sep): New.
2002-04-29 Paul Eggert <eggert@twinsun.com>
* bin/autoreconf.in (autoreconf): Don't age aclocal.m4's input

View File

@ -437,6 +437,20 @@ m4_define([m4_map],
m4_map([$1], m4_cdr($2))])])
# m4_map_sep(MACRO, SEPARATOR, LIST)
# ----------------------------------
# Invoke MACRO($1), SEPARATOR, MACRO($2), ..., MACRO($N) where $1, $2... $N
# are the elements of LIST (which can be lists themselves, for multiple
# arguments MACROs).
m4_define([m4_map_sep],
[m4_if([$3], [[]], [],
[$1(m4_fst($3))[]dnl
m4_if(m4_cdr($3),
[[]], [],
[$2])[]dnl
m4_map_sep([$1], [$2], m4_cdr($3))])])
## ---------------------------------------- ##
## 6. Enhanced version of some primitives. ##
## ---------------------------------------- ##