diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-11-18 06:56:45 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-11-18 06:56:45 +0100 |
commit | e1c9cf60e2dbc13107544cbd1798c144357914eb (patch) | |
tree | eae657f278fe6d44719b0776cc9a11016380a54d | |
parent | stylo (diff) | |
download | mds-e1c9cf60e2dbc13107544cbd1798c144357914eb.tar.gz mds-e1c9cf60e2dbc13107544cbd1798c144357914eb.tar.bz2 mds-e1c9cf60e2dbc13107544cbd1798c144357914eb.tar.xz |
alternation in macro calls and for-loops
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r-- | doc/info/mds.texinfo | 25 |
1 files changed, 25 insertions, 0 deletions
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. + |