manpagez: man pages & more
info m4
Home | html | info | man

File: m4.info,  Node: Conditionals,  Next: Debugging,  Prev: Definitions,  Up: Top

6 Conditionals, loops, and recursion
************************************

Macros, expanding to plain text, perhaps with arguments, are not quite
enough.  We would like to have macros expand to different things, based
on decisions taken at run-time.  For that, we need some kind of
conditionals.  Also, we would like to have some kind of loop construct,
so we could do something a number of times, or while some condition is
true.

* Menu:

* 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

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.