a28 Improperly Nested Constructs Contents|Index|Previous|Next
 

Improperly nested constructs 

Recall that when a macro is called with arguments, the arguments are substituted into the macro body and the result is checked, together with the rest of the input file, for more macro calls. It is possible to piece together a macro call coming partially from the macro body and partially from the actual arguments. Use the following input as an example.

This input would expand call_with_1 (double) into (2*(1)).

Macro definitions do not have to have balanced parentheses. By writing an unbalanced open parenthesis in a macro body, it is possible to create a macro call that begins inside the macro body but ends outside of it. Use the following input as an example.

The previous bizarre example expands to the following output. 0