Metalang99
1.13.3
Full-blown preprocessor metaprogramming
lang.h
Go to the documentation of this file.
1
6
#ifndef ML99_LANG_H
7
#define ML99_LANG_H
8
9
#include <metalang99/priv/bool.h>
10
#include <metalang99/priv/tuple.h>
11
12
#include <metalang99/eval/eval.h>
13
#include <metalang99/lang/closure.h>
14
28
#define ML99_EVAL(...) ML99_PRIV_EVAL(__VA_ARGS__)
29
33
#define ML99_call(op, ...) \
34
(ML99_PRIV_IF(ML99_PRIV_IS_UNTUPLE_FAST(op), 0args, 0op), op, __VA_ARGS__)
35
42
#define ML99_callUneval(ident, ...) (0callUneval, ident, __VA_ARGS__)
43
93
#define ML99_appl(f, ...) ML99_call(ML99_appl, f, __VA_ARGS__)
94
110
#define ML99_appl2(f, a, b) ML99_call(ML99_appl2, f, a, b)
111
115
#define ML99_appl3(f, a, b, c) ML99_call(ML99_appl3, f, a, b, c)
116
120
#define ML99_appl4(f, a, b, c, d) ML99_call(ML99_appl4, f, a, b, c, d)
121
140
#define ML99_compose(f, g) ML99_call(ML99_compose, f, g)
141
145
#define v(...) (0v, __VA_ARGS__)
146
147
// clang-format off
174
#define ML99_fatal(f, ...) (0fatal, f, #__VA_ARGS__)
175
// clang-format on
176
191
#define ML99_abort(...) (0abort, __VA_ARGS__)
192
206
#define ML99_TERMS(...) __VA_ARGS__
207
226
#define ML99_QUOTE(...) v(__VA_ARGS__)
227
228
#ifndef DOXYGEN_IGNORE
229
230
#define ML99_compose_IMPL(f, g) ML99_appl2_IMPL(ML99_PRIV_compose, f, g)
231
#define ML99_PRIV_compose_IMPL(f, g, x) ML99_appl(v(f), ML99_appl_IMPL(g, x))
232
233
// Arity specifiers {
234
235
#define ML99_appl_ARITY 2
236
#define ML99_appl2_ARITY 3
237
#define ML99_appl3_ARITY 4
238
#define ML99_appl4_ARITY 5
239
#define ML99_compose_ARITY 2
240
241
#define ML99_PRIV_compose_ARITY 3
242
// } (Arity specifiers)
243
244
#endif
// DOXYGEN_IGNORE
245
246
#endif
// ML99_LANG_H
include
metalang99
lang.h
Generated by
1.9.4