Next: , Previous: Macro Arguments, Up: Macros


3.4 On Quoting Arguments to macros

Each argument has leading unquoted whitespace removed. Within each argument, all unquoted parentheses must match. For example, if foo is a macro,

     foo(() (`(') `(')

is a macro call, with one argument, whose value is `() (() ('. Commas separate arguments, except when they occur inside quotes, comments, or unquoted parentheses, See Pseudo Arguments, for examples.

It is common practice to quote all arguments to macros, unless you are sure you want the arguments expanded. Thus, in the above example with the parentheses, the `right' way to do it is like this:

     foo(`() (() (')

It is, however, in certain cases necessary or convenient to leave out quotes for some arguments, and there is nothing wrong in doing it. It just makes life a bit harder, if you are not careful. For consistency, this manual follows the rule of thumb that each layer of parentheses introduces another layer of single quoting, except when showing the consequences of quoting rules. This is done even when the quoted string cannot be a macro, such as with integers when you have not changed the syntax via changeword (see Changeword).