GNU Info

Info Node: (m4.info)Define

(m4.info)Define


Next: Arguments Prev: Definitions Up: Definitions
Enter node , (file) or (file)node

Defining a macro
================

   The normal way to define or redefine macros is to use the builtin
`define':

     define(NAME [, EXPANSION])

which defines NAME to expand to EXPANSION.  If EXPANSION is not given,
it is taken to be empty.

   The expansion of `define' is void.

   The following example defines the macro FOO to expand to the text
`Hello World.'.

     define(`foo', `Hello world.')
     =>
     foo
     =>Hello world.

   The empty line in the output is there because the newline is not a
part of the macro definition, and it is consequently copied to the
output.  This can be avoided by use of the macro `dnl'.  Note: Dnl,
for details.

   The macro `define' is recognized only with parameters.


automatically generated by info2www version 1.2.2.9