Loading...
Searching...
No Matches
lang.h
Go to the documentation of this file.
#ifndef ML99_LANG_H
#define ML99_LANG_H
#include <metalang99/priv/bool.h>
#include <metalang99/priv/tuple.h>
#include <metalang99/eval/eval.h>
#include <metalang99/lang/closure.h>
#define ML99_EVAL(...) ML99_PRIV_EVAL(__VA_ARGS__)
#define ML99_call(op, ...) \
(ML99_PRIV_IF(ML99_PRIV_IS_UNTUPLE_FAST(op), 0args, 0op), op, __VA_ARGS__)
#define ML99_callUneval(ident, ...) (0callUneval, ident, __VA_ARGS__)
#define ML99_appl(f, ...) ML99_call(ML99_appl, f, __VA_ARGS__)
#define ML99_appl2(f, a, b) ML99_call(ML99_appl2, f, a, b)
#define ML99_appl3(f, a, b, c) ML99_call(ML99_appl3, f, a, b, c)
#define ML99_appl4(f, a, b, c, d) ML99_call(ML99_appl4, f, a, b, c, d)
#define ML99_compose(f, g) ML99_call(ML99_compose, f, g)
#define v(...) (0v, __VA_ARGS__)
// clang-format off
#define ML99_fatal(f, ...) (0fatal, f, #__VA_ARGS__)
// clang-format on
#define ML99_abort(...) (0abort, __VA_ARGS__)
#define ML99_TERMS(...) __VA_ARGS__
#define ML99_QUOTE(...) v(__VA_ARGS__)
#ifndef DOXYGEN_IGNORE
#define ML99_compose_IMPL(f, g) ML99_appl2_IMPL(ML99_PRIV_compose, f, g)
#define ML99_PRIV_compose_IMPL(f, g, x) ML99_appl(v(f), ML99_appl_IMPL(g, x))
// Arity specifiers {
#define ML99_appl_ARITY 2
#define ML99_appl2_ARITY 3
#define ML99_appl3_ARITY 4
#define ML99_appl4_ARITY 5
#define ML99_compose_ARITY 2
#define ML99_PRIV_compose_ARITY 3
// } (Arity specifiers)
#endif // DOXYGEN_IGNORE
#endif // ML99_LANG_H