The IFZERO macro expects three parameter lists, just as the other IF... macros: a symbol, a true-list and a false-list. The first argument defines whether the whole macro expands to the true-list or to the false-list. The first argument may be: You can use COUNTERVALUE(somecounter) as the argument to IFZERO, it is treated in the same manner as the corresponding counter name. Example: The IFZERO macro offers a very simple way to pass a flag-argument (an on/off switch) to a macro. E.g., in LaTeX you start environments with \begin{environment} and end them with \end{environment}; environment being e.g., center, flushright, flushleft. A possible meta-macro for the environments might be:
DEFINEMACRO(environment)(2)(\ 
    IFZERO(ARG2)\ 
        NOEXPAND(\end{ARG1})\ 
        NOEXPAND(\begin{ARG1}))

Such a macro may be used as:

environment(center)(1)
Now comes centered text.
environment(center)(0)

which would of course lead to \begin and \end{center}. The numeric second argument is used here as a on/off switch.


Go back to index of Yodl.

Please send Yodl questions and comments to yodl@icce.rug.nl.

Please send comments on these web pages to (address unknown)

Copyright (c) 1997, 1998, 1999 Karel Kubat and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from Yodl-1.31.18 by

<(address unknown)>, Tue Apr 15 19:40:55 2008 MSD.