Flow control primitives |
This primitive can be used to typeset if-body only if the condition is satisfied. If the optional else-body is specified, then it is typeset if and only if the condition fails.
<macro|x|<if|<visibility-flag>|x>>
the macro argument x is accessible if and only if <visibility-flag> evaluates to true. This condition cannot necessarily be checked a priori. For certain editing operations, like searches or spell checking, the incorrect determination of the accessability may lead to the positioning of the cursor at unaccessible places, or to the ignorance of certain markup. In the future, we plan to improve this aspect of the editor, but it is better to avoid conditional markup whenever another solution can be found.
<assign|cold|<macro|x|<with|color|blue|x>>>
<assign|hot|<macro|x|<with|color|red|x>>>
<assign|adaptive|<macro|x|<compound|<if|<summer>|hot|cold>|x>>>
These commands are respectively equivalent to
<if|cond-1|body-1|⋯<if|cond-n|body-n>>
<if|cond-1|body-1|⋯<if|cond-n|body-n|else-body>>
This construct maybe used in order to repeatly execute a given body while a given condition is satisfied. For instance, when declaring
<
assign
|
count
|
<
macro
|
from
|
to
|
<
with
|
i
|
from
|
<\concat|
<while|<less|i|to>|i,
<assign|i|<plus|i|1>>>
to
the code <count|1|50> produces
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50