| Search internet |
Macros are defined by macro definitions of form

As an example,
is macro defined by a definition like this:

Furthermore,
macro expands into a macro definition of form

So
is macro defined such that it macro expands into a macro definition.
The
construct is not at all easy to use. One pitfall is that macro expansion also occurs inside macro definitions. So one has to protect the left hand side of a macro definition against macro expansion. To see this, consider a simple macro:

When lgc(1) loads a page, it 'reads' it several times. These 'readings' are referred to as 'first reading', 'second reading', and so on. Now consider the macro definition of parentheses above. At first reading, parentheses are not macro defined. At second reading, parentheses are macro defined such that they disappear. The
construct is macro defined such that it protects its left hand side against macro expansion. But if it did not protect its left hand side, then
would macro expand to
. That would make x macro expand to itself, leading to an infinite loop during third reading.
| Search logiweb.eu |