Category:M4: Difference between revisions

m
correction, changequote() for the quote chars, not changecom()
(Expand introduction a little, note properly tail recursive)
m (correction, changequote() for the quote chars, not changecom())
 
Line 16:
Control flow is limited to <code>ifelse</code>, but it's easy to construct loops by recursion. GNU m4 includes examples of macros implementing various general-purpose loops.
 
Quoting data values against premature or unwanted expansion can be a little tricky. The default quote characters are <code>`</code> and <code>'</code>. If they would occur in text too often then <code>changecomchangequote()</code> can set something else. Autoconf changes to <code>[</code> and <code>]</code> since <code>`</code> and <code>'</code> occur often in its [[Bourne Shell]] output.
 
When a macro expands, its value (with <code>$1</code> etc parameters substituted) is re-read as input. This is how macro definitions can contain further macros to expand.