DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(m4.info.gz) Ifdef

Info Catalog (m4.info.gz) Conditionals (m4.info.gz) Ifelse
 
 5.1 Testing if a macro is defined
 =================================
 
 There are two different builtin conditionals in `m4'.  The first is
 `ifdef':
 
  -- Builtin: ifdef (NAME, STRING-1, [STRING-2])
      If NAME is defined as a macro, `ifdef' expands to STRING-1,
      otherwise to STRING-2.  If STRING-2 is omitted, it is taken to be
      the empty string (according to the normal rules).
 
      The macro `ifdef' is recognized only with parameters.
 
      ifdef(`foo', ``foo' is defined', ``foo' is not defined')
      =>foo is not defined
      define(`foo', `')
      =>
      ifdef(`foo', ``foo' is defined', ``foo' is not defined')
      =>foo is defined
      ifdef(`no_such_macro', `yes', `no', `extra argument')
      error-->m4:stdin:4: Warning: excess arguments to builtin `ifdef' ignored
      =>no
 
Info Catalog (m4.info.gz) Conditionals (m4.info.gz) Ifelse
automatically generated byinfo2html