|  21.4.2 Macro management 
A number of built-in macros exist in M4 to manage macros.  We
shall examine the most common ones that you're likely to encounter.
There are others and you should consult the GNU M4 manual for
further information.
 
The most obvious one is define, which defines a macro.  It
expands to the empty string: 
 |  | define([foo], [bar])dnl
define([combine], [$1 and $2])dnl
 | 
 
It is worth highlighting again the liberal use of quoting.  We wish to
define a pair of macros whose names are literally fooandcombine.  If another macro had been previously defined with
either of these names,m4would have expanded the macro
immediately and passed the expansion offootodefine,
giving unexpected results. 
The undefinemacro will remove a macro's definition from
M4's macro table.  It also expands to the empty string: 
 |  | undefine([foo])dnl
undefine([combine])dnl
 | 
 
Recall that once removed from the macro table, unmatched text will once
more be passed through to the output.
 
The defnmacro expands to the definition of a macro, named by the
single argument todefn.  It is quoted, so that it can be used as
the body of a new, renamed macro: 
 |  | define([newbie], defn([foo]))dnl
undefine([foo])dnl
 | 
 
The ifdefmacro can be used to determine if a macro name has an
existing definition.  If it does exist,ifdefexpands to the
second argument, otherwise it expands to the third: 
 |  | ifdef([foo], [yes], [no])dnl
 | 
 
Again, yesandnohave been quoted to prevent expansion
due to any pre-existing macros with those names.  Always consider
this a real possibility! 
Finally, a word about built-in macros: these macros are all defined for
you when m4is started.  One common problem with these macros
is that they are not in any kind of name space, so it's easier to
accidentally invoke them or want to define a macro with an existing
name.  One solution is to use thedefineanddefncombination shown above to rename all of the macros, one by one.  This
is how Autoconf makes the distinction clear. 
 |