From e1c9cf60e2dbc13107544cbd1798c144357914eb Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 18 Nov 2014 06:56:45 +0100 Subject: alternation in macro calls and for-loops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/info/mds.texinfo | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/info/mds.texinfo b/doc/info/mds.texinfo index 65099d4..225ba4d 100644 --- a/doc/info/mds.texinfo +++ b/doc/info/mds.texinfo @@ -5619,6 +5619,31 @@ letter("ö" "Ö") @code{\add( )} and @code{\sub( )} are calls to two built-in functions named `add/2' and `sub/2'. +Alternation can be used to invoke a macro: + +@example +letter(["a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m"]) +letter(["n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"]) +@end example + +You may use `.' in an alternation, in that case +macro is called once with the argument, casing it +to invoke for example `letter/0' instead of +`letter/1'. + +A related issue are for-loops. If we for +example want to call the macro `letter/2' for +all letters betweeh and including `a' and `z' +we can just write + +@example +for "a" to "z" as \1 + letter(\1) +end for +@end example + +instead of using the alternation-trick. + -- cgit v1.2.3-70-g09d2