1 1 6 Conditionals, loops, and recursion 1 ************************************ 1 1 Macros, expanding to plain text, perhaps with arguments, are not quite 1 enough. We would like to have macros expand to different things, based 1 on decisions taken at run-time. For that, we need some kind of 1 conditionals. Also, we would like to have some kind of loop construct, 1 so we could do something a number of times, or while some condition is 1 true. 1
1 · Ifdef Testing if a macro is defined · Ifelse If-else construct, or multibranch · Shift Recursion in 'm4' · Forloop Iteration by counting · Foreach Iteration by list contents · Stacks Working with definition stacks · Composition Building macros with macros 1