Next: , Previous: , Up: Macros   [Contents][Index]


7.2 FWEB macros

FWEB macros (sometimes called inner macros) are defined by ‘@m’ (see ATm) or ‘@M’ (see ATM_). These should normally be placed in the definition part, as in

@n
@ Documentation...

@m CUBE(x) (x)**3

@a
        z3 = CUBE(x) + CUBE(y)

(the appearance of an ‘@m’ in the documentation part begins the definition part). They are collected during FTANGLE’s phase 1 and effectively placed at the top of the unnamed section, so they are all known during the output in phase 2.

In unusual situations when macros are being conditionally defined and/or undefined, the order of processing a macro definition becomes significant. If the command-line option ‘-TD’ is used, then FWEB macros may be used in the code part as well; they are then called deferred macros. These definitions will be processed during phase 2 in the order that the code sections are processed, which may not be the same as the physical order in the source file.

The use of deferred macros is highly discouraged, for the following reason. FWEB macros are often used in conjunction with the FWEB preprocessor commands. Preprocessor commands are always processed during phase 1, so they do not interact properly with deferred macros. It is for this reason that deferred macros are normally prohibited from appearing in the code part.


Next: , Previous: , Up: Macros   [Contents][Index]