Metalang99 1.13.3
Full-blown preprocessor metaprogramming
bool.h
Go to the documentation of this file.
1
6#ifndef ML99_BOOL_H
7#define ML99_BOOL_H
8
9#include <metalang99/priv/bool.h>
10#include <metalang99/priv/tuple.h>
11
12#include <metalang99/lang.h>
13
17#define ML99_true(...) ML99_callUneval(ML99_true, )
18
22#define ML99_false(...) ML99_callUneval(ML99_false, )
23
39#define ML99_not(x) ML99_call(ML99_not, x)
40
62#define ML99_and(x, y) ML99_call(ML99_and, x, y)
63
84#define ML99_or(x, y) ML99_call(ML99_or, x, y)
85
107#define ML99_xor(x, y) ML99_call(ML99_xor, x, y)
108
130#define ML99_boolEq(x, y) ML99_call(ML99_boolEq, x, y)
131
153#define ML99_boolMatch(x, matcher) ML99_call(ML99_boolMatch, x, matcher)
154
173#define ML99_boolMatchWithArgs(x, matcher, ...) \
174 ML99_call(ML99_boolMatchWithArgs, x, matcher, __VA_ARGS__)
175
191#define ML99_if(cond, x, y) ML99_call(ML99_if, cond, x, y)
192
203#define ML99_IF(cond, x, y) ML99_PRIV_UNTUPLE(ML99_PRIV_IF(cond, (x), (y)))
204
205#define ML99_TRUE(...) 1
206#define ML99_FALSE(...) 0
207
208#define ML99_NOT(x) ML99_PRIV_NOT(x)
209#define ML99_AND(x, y) ML99_PRIV_AND(x, y)
210#define ML99_OR(x, y) ML99_PRIV_OR(x, y)
211#define ML99_XOR(x, y) ML99_PRIV_XOR(x, y)
212#define ML99_BOOL_EQ(x, y) ML99_PRIV_BOOL_EQ(x, y)
213
214#ifndef DOXYGEN_IGNORE
215
216#define ML99_true_IMPL(...) v(ML99_TRUE())
217#define ML99_false_IMPL(...) v(ML99_FALSE())
218
219#define ML99_not_IMPL(x) v(ML99_NOT(x))
220#define ML99_and_IMPL(x, y) v(ML99_AND(x, y))
221#define ML99_or_IMPL(x, y) v(ML99_OR(x, y))
222#define ML99_xor_IMPL(x, y) v(ML99_XOR(x, y))
223#define ML99_boolEq_IMPL(x, y) v(ML99_BOOL_EQ(x, y))
224
225#define ML99_boolMatch_IMPL(x, matcher) ML99_callUneval(matcher##x, )
226#define ML99_boolMatchWithArgs_IMPL(x, matcher, ...) ML99_callUneval(matcher##x, __VA_ARGS__)
227
228#define ML99_if_IMPL(cond, x, y) v(ML99_PRIV_IF(cond, x, y))
229
230// Arity specifiers {
231
232#define ML99_true_ARITY 1
233#define ML99_false_ARITY 1
234#define ML99_not_ARITY 1
235#define ML99_and_ARITY 2
236#define ML99_or_ARITY 2
237#define ML99_xor_ARITY 2
238#define ML99_boolEq_ARITY 2
239#define ML99_boolMatch_ARITY 2
240#define ML99_boolMatchWithArgs_ARITY 3
241#define ML99_if_ARITY 3
242// } (Arity specifiers)
243
244#endif // DOXYGEN_IGNORE
245
246#endif // ML99_BOOL_H
The core metalanguage.