m4: Dumpdef
1
1 7.1 Displaying macro definitions
1 ================================
1
1 If you want to see what a name expands into, you can use the builtin
1 'dumpdef':
1
1 -- Builtin: dumpdef ([NAMES...])
1 Accepts any number of arguments. If called without any arguments,
1 it displays the definitions of all known names, otherwise it
1 displays the definitions of the NAMES given. The output is printed
1 to the current debug file (usually standard error), and is sorted
1 by name. If an unknown name is encountered, a warning is printed.
1
1 The expansion of 'dumpdef' is void.
1
1 $ m4 -d
1 define(`foo', `Hello world.')
1 =>
1 dumpdef(`foo')
1 error->foo: =>
1 dumpdef(`define')
1 error->define: =>
1
1 The last example shows how builtin macros definitions are displayed.
1 The definition that is dumped corresponds to what would occur if the
1 macro were to be called at that point, even if other definitions are
1 still live due to redefining a macro during argument collection.
1
1 $ m4 -d
1 pushdef(`f', ``$0'1')pushdef(`f', ``$0'2')
1 =>
1 f(popdef(`f')dumpdef(`f'))
1 error->f: =>f2
1 f(popdef(`f')dumpdef(`f'))
1 error->m4:stdin:3: undefined macro `f'
1 =>f1
1
1 ⇒Debug Levels, for information on controlling the details of
1 the display.
1