m4: Undefine

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