|
Metalang99 1.13.5
Full-blown preprocessor metaprogramming
|
Utilitary stuff. More...

Go to the source code of this file.
Macros | |
| #define | ML99_catEval(a, b) |
Concatenates a with b and evaluates the result. | |
| #define | ML99_cat(a, b) |
Concatenates a with b, leaving the result unevaluated. | |
| #define | ML99_cat3(a, b, c) |
| The same as ML99_cat but deals with 3 parameters. | |
| #define | ML99_cat4(a, b, c, d) |
| The same as ML99_cat but deals with 4 parameters. | |
| #define | ML99_stringify(...) |
| Stringifies provided arguments. | |
| #define | ML99_empty(...) |
| Evaluates to nothing. | |
| #define | ML99_id(...) |
| Evaluates to its arguments. | |
| #define | ML99_const(x, a) |
Evaluates to x, skipping a. | |
| #define | ML99_flip(f) |
Reverses the order of arguments of the binary function f. | |
| #define | ML99_uncomma(...) |
| Accepts terms and evaluates them with the space-separator. | |
| #define | ML99_reify(f) |
Turns f into a Metalang99-compliant metafunction with the arity of 1, which can be then called by ML99_appl. | |
| #define | ML99_todo(f) |
Indicates not yet implemented functionality of the macro f. | |
| #define | ML99_todoWithMsg(f, message) |
| The same as ML99_todo but emits a caller-supplied message. | |
| #define | ML99_unimplemented(f) |
Indicates unimplemented functionality of the macro f. | |
| #define | ML99_unimplementedWithMsg(f, message) |
| The same as ML99_unimplemented but emits a caller-supplied message. | |
| #define | ML99_GEN_SYM(prefix, id) |
Generates a unique identifier id in the namespace prefix. | |
| #define | ML99_TRAILING_SEMICOLON(...) |
| Forces a caller to put a trailing semicolon. | |
| #define | ML99_CAT_PRIMITIVE(a, b) |
Concatenates a with b as-is, without expanding them. | |
| #define | ML99_CAT3_PRIMITIVE(a, b, c) |
| The same as ML99_CAT_PRIMITIVE but deals with 3 parameters. | |
| #define | ML99_CAT4_PRIMITIVE(a, b, c, d) |
| The same as ML99_CAT_PRIMITIVE but deals with 4 parameters. | |
| #define | ML99_STRINGIFY_PRIMITIVE(...) |
Stringifies x as-is, without expanding it. | |
| #define | ML99_LPAREN(...) |
| Expands to an opening parenthesis ((). | |
| #define | ML99_RPAREN(...) |
| The same as ML99_LPAREN but emits a closing parenthesis. | |
| #define | ML99_COMMA(...) |
| Expands to a single comma, consuming all arguments. | |
| #define | ML99_GCC_PRAGMA(str) |
| If you are compiling on GCC, this macro expands to _Pragma(str), otherwise to emptiness. | |
| #define | ML99_CLANG_PRAGMA(str) |
| The same as ML99_GCC_PRAGMA but for Clang. | |
| #define | ML99_CAT(a, b) |
| #define | ML99_CAT3(a, b, c) |
| #define | ML99_CAT4(a, b, c, d) |
| #define | ML99_STRINGIFY(...) |
| #define | ML99_EMPTY(...) |
| #define | ML99_ID(...) |
Utilitary stuff.
| #define ML99_CAT | ( | a, | |
| b ) |
| #define ML99_cat | ( | a, | |
| b ) |
Concatenates a with b, leaving the result unevaluated.
| #define ML99_CAT3 | ( | a, | |
| b, | |||
| c ) |
| #define ML99_cat3 | ( | a, | |
| b, | |||
| c ) |
| #define ML99_CAT3_PRIMITIVE | ( | a, | |
| b, | |||
| c ) |
The same as ML99_CAT_PRIMITIVE but deals with 3 parameters.
| #define ML99_CAT4 | ( | a, | |
| b, | |||
| c, | |||
| d ) |
| #define ML99_cat4 | ( | a, | |
| b, | |||
| c, | |||
| d ) |
| #define ML99_CAT4_PRIMITIVE | ( | a, | |
| b, | |||
| c, | |||
| d ) |
The same as ML99_CAT_PRIMITIVE but deals with 4 parameters.
| #define ML99_CAT_PRIMITIVE | ( | a, | |
| b ) |
Concatenates a with b as-is, without expanding them.
| #define ML99_catEval | ( | a, | |
| b ) |
Concatenates a with b and evaluates the result.
| #define ML99_CLANG_PRAGMA | ( | str | ) |
The same as ML99_GCC_PRAGMA but for Clang.
| #define ML99_COMMA | ( | ... | ) |
Expands to a single comma, consuming all arguments.
| #define ML99_const | ( | x, | |
| a ) |
| #define ML99_empty | ( | ... | ) |
Evaluates to nothing.
| #define ML99_flip | ( | f | ) |
Reverses the order of arguments of the binary function f.
| #define ML99_GCC_PRAGMA | ( | str | ) |
If you are compiling on GCC, this macro expands to _Pragma(str), otherwise to emptiness.
| #define ML99_GEN_SYM | ( | prefix, | |
| id ) |
Generates a unique identifier id in the namespace prefix.
Let FOO be the name of an enclosing macro. Then FOO_ must be specified for prefix, and id should be given any meaningful name (this makes debugging easier).
| #define ML99_ID | ( | ... | ) |
| #define ML99_id | ( | ... | ) |
| #define ML99_LPAREN | ( | ... | ) |
Expands to an opening parenthesis (().
This is helpful when you want to delay macro arguments passing: just type BAR ML99_LPAREN() initial args... at the end of some macro FOO and complete the invocation of BAR with the rest of args...) in future.
This macro consumes all its arguments.
| #define ML99_reify | ( | f | ) |
Turns f into a Metalang99-compliant metafunction with the arity of 1, which can be then called by ML99_appl.
f can be any C function or function-like macro.
Without ML99_reify, you would need to write some additional boilerplate:
| #define ML99_RPAREN | ( | ... | ) |
The same as ML99_LPAREN but emits a closing parenthesis.
| #define ML99_STRINGIFY | ( | ... | ) |
| #define ML99_stringify | ( | ... | ) |
| #define ML99_STRINGIFY_PRIMITIVE | ( | ... | ) |
Stringifies x as-is, without expanding it.
| #define ML99_todo | ( | f | ) |
Indicates not yet implemented functionality of the macro f.
ML99_todo is the same as ML99_unimplemented except that the former conveys an intent that the functionality is to be implemented later but ML99_unimplemented makes no such claims.
| #define ML99_todoWithMsg | ( | f, | |
| message ) |
The same as ML99_todo but emits a caller-supplied message.
message must be a string literal.
| #define ML99_TRAILING_SEMICOLON | ( | ... | ) |
Forces a caller to put a trailing semicolon.
It is useful when defining macros, to make them formatted as complete statements.
| #define ML99_uncomma | ( | ... | ) |
Accepts terms and evaluates them with the space-separator.
| #define ML99_unimplemented | ( | f | ) |
Indicates unimplemented functionality of the macro f.
ML99_unimplemented is the same as ML99_todo except that the latter conveys an intent that the functionality is to be implemented later but ML99_unimplemented makes no such claims.
| #define ML99_unimplementedWithMsg | ( | f, | |
| message ) |
The same as ML99_unimplemented but emits a caller-supplied message.
message must be a string literal.