DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(m4.info) Defn

Info Catalog (m4.info) Undefine (m4.info) Definitions (m4.info) Pushdef
 
 Renaming macros
 ===============
 
    It is possible to rename an already defined macro.  To do this, you
 need the builtin `defn':
 
      defn(NAME)
 
 which expands to the *quoted definition* of NAME.  If the argument is
 not a defined macro, the expansion is void.
 
    If NAME is a user-defined macro, the quoted definition is simply the
 quoted expansion text.  If, instead, NAME is a builtin, the expansion
 is a special token, which points to the builtin's internal definition.
 This token is only meaningful as the second argument to `define' (and
 `pushdef'), and is ignored in any other context.
 
    Its normal use is best understood through an example, which shows
 how to rename `undefine' to `zap':
 
      define(`zap', defn(`undefine'))
      =>
      zap(`undefine')
      =>
      undefine(`zap')
      =>undefine(zap)
 
    In this way, `defn' can be used to copy macro definitions, and also
 definitions of builtin macros.  Even if the original macro is removed,
 the other name can still be used to access the definition.
 
    The macro `defn' is recognized only with parameters.
 
Info Catalog (m4.info) Undefine (m4.info) Definitions (m4.info) Pushdef
automatically generated byinfo2html