$P
: The C preprocessor symbol$P
is (essentially) a synonym for ‘$UNQUOTE("#")’
(see $UNQUOTE). It is useful for constructing Fweb macro
definitions that expand to C preprocessor statements. For example,
@m CHECK(flag) $P if(flag) special code; $P endif
Another version of the preprocessor symbol is $PP
(see $PP).
For most purposes, $P
and $PP
will behave in exactly the
same way. The difference between them is that $P
is treated as a
string (without surrounding quotes), whereas $PP
is treated as a
character. The character nature of $PP
is used by Fortran
to reset the column number to 1, so C-like preprocessor commands appear
there rather than in column 7.
For further discussion of strings and the differences between $P
and $PP
, see Strings and quotes.