[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: m4_map_sep
From: |
Akim Demaille |
Subject: |
FYI: m4_map_sep |
Date: |
03 May 2002 10:16:49 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) |
Index: ChangeLog
from Akim Demaille <address@hidden>
* lib/m4sugar/m4sugar.m4 (m4_map_sep): New.
Index: lib/m4sugar/m4sugar.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sugar.m4,v
retrieving revision 2.65
diff -u -u -r2.65 m4sugar.m4
--- lib/m4sugar/m4sugar.m4 21 Apr 2002 07:25:21 -0000 2.65
+++ lib/m4sugar/m4sugar.m4 3 May 2002 08:15:41 -0000
@@ -437,6 +437,20 @@
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. ##
## ---------------------------------------- ##
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: m4_map_sep,
Akim Demaille <=