Yodl recognizes the arguments to a macro as parameter lists, i.e., delimited by ( and ). As long as the number of opening and closing parentheses matches, Yodl will correctly recognize the list. E.g., given a hypothetical macro somemacro, the following code sample shows the macro followed by one parameter list:
somemacro(Here is a chunk of text.)
somemacro(Here is a some (more) text.)

A problem arises when the number of parentheses is unbalanced: i.e., when the parameter list consists of more opening than closing parentheses or v.v.. To handle such situations, Yodl offers a `literal-character' mechanism (see the CHAR macro in ??) and a `global substitution' mechanism (see the SUBST macro in ??). For example, to send the text

here's a ")" closing parenthesis

as an argument to our hypothetical macro somemacro, the following can be used:

COMMENT(-- Alternative 1: using CHAR --)
somemacro(here's a "CHAR(41)" closing parenthesis)

COMMENT(-- Alternative 2: using SUBST --)
SUBST(closepar)(CHAR(41))
.
.
somemacro(here's a "closepar" closing parenthesis)

Both methods have disadvantages: the CHAR method requires you to remember that an ASCII 41 is a closing parenthesis. The SUBST method defines a string closepar that is always expanded to a closing parenthesis, wherever in the text it occurs. Nevertheless, unbalanced parameter lists can be handled by Yodl. (If the here described method proves to be too much of a pain, I'll think of something. As for myself, I've never yet have felt the need to use an unbalanced parameter list -- except in this document..) Also, remember that unbalanced parenthesis pairs are only relevant in argument lists. Yodl handles parentheses in normal text as ordinary characters.


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

Dmitry V. Levin <(address unknown)>, Mon Oct 21 20:34:42 2002 MSD.