Next: Defn, Previous: Pseudo Arguments, Up: Definitions
A macro definition can be removed with undefine:
For each argument, remove the macro name. The macro names must necessarily be quoted, since they will be expanded otherwise.
The expansion of
undefineis void. The macroundefineis recognized only with parameters.
foo bar blah
=>foo bar blah
define(`foo', `some')define(`bar', `other')define(`blah', `text')
=>
foo bar blah
=>some other text
undefine(`foo')
=>
foo bar blah
=>foo other text
undefine(`bar', `blah')
=>
foo bar blah
=>foo bar blah
Undefining a macro inside that macro's expansion is safe; the macro still expands to the definition that was in effect at the `('.
define(`f', ``$0':$1')
=>
f(f(f(undefine(`f')`hello world')))
=>f:f:f:hello world
f(`bye')
=>f(bye)
It is not an error for name to have no macro definition. In that
case, undefine does nothing.