summaryrefslogtreecommitdiff
path: root/doc/examples/wraplifo2.m4
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/wraplifo2.m4')
-rw-r--r--doc/examples/wraplifo2.m49
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/examples/wraplifo2.m4 b/doc/examples/wraplifo2.m4
new file mode 100644
index 00000000..5b450a76
--- /dev/null
+++ b/doc/examples/wraplifo2.m4
@@ -0,0 +1,9 @@
+dnl Redefine m4wrap to have LIFO semantics, improved example.
+include(`join.m4')dnl
+define(`_m4wrap', defn(`m4wrap'))dnl
+define(`_arg1', `$1')dnl
+define(`m4wrap',
+`ifdef(`_$0_text',
+ `define(`_$0_text', joinall(` ', $@)defn(`_$0_text'))',
+ `_$0(`_arg1(defn(`_$0_text')undefine(`_$0_text'))')dnl
+define(`_$0_text', joinall(` ', $@))')')dnl