An eĿlipsis extension to process a list in the preprocessor. More...
Macros | |
#define | ARGS |
The argument list that must be set before entering this source. | |
#define | BODY(…) |
The body that will be invoked for each iteration value. | |
#define | RESULT |
The name of the macro that will hold the result of the iteration. | |
#define | SEPARATOR |
A separator that is inserted between each iteration. | |
An eĿlipsis extension to process a list in the preprocessor.
Use this such as in
This assigns the token sequence "a" "b" "c"
to the macro MY_STRINGS
. If that macro had been set before, the old value is overwritten without producing an error.
The macros ARGS
, RESULT
and BODY
contain the information for the loop and should be set prior to the inclusion. To avoid pollution they are best set as indicated by bind directives, such that they are undefined after the execution of the include_directives
directive.
Both ARGS
and BODY
should either themselves be functional macros, or expand to the name of such a functional macro, where the one for ARGS
receives no arguments, and the one for BODY
has a ...
parameter.
For example ARGS
could directly be defined as
or another macro could be called indirectly
Similar for BODY
or
A fourth optional macro SEPARATOR
macro may hold a separator that is spliced between the output items. For example
results in a macro MY_ORS
that is set to a ∨ b ∨ c
.
#define ARGS |
The argument list that must be set before entering this source.
Arguments are separated by commas, each argument may consist of several tokens or be empty.
#define BODY | ( | … | ) |
The body that will be invoked for each iteration value.
The easiest is to have that given has here, that is with a …
list of parameters.
#define RESULT |
The name of the macro that will hold the result of the iteration.
#define SEPARATOR |
A separator that is inserted between each iteration.