Loading...
Searching...
No Matches
choice.h
Go to the documentation of this file.
#ifndef ML99_CHOICE_H
#define ML99_CHOICE_H
#include <metalang99/priv/util.h>
#include <metalang99/lang.h>
#define ML99_choice(tag, ...) ML99_call(ML99_choice, tag, __VA_ARGS__)
#define ML99_choiceTag(choice) ML99_call(ML99_choiceTag, choice)
#define ML99_choiceData(choice) ML99_call(ML99_choiceData, choice)
#define ML99_match(choice, matcher) ML99_call(ML99_match, choice, matcher)
#define ML99_matchWithArgs(choice, matcher, ...) \
ML99_call(ML99_matchWithArgs, choice, matcher, __VA_ARGS__)
#define ML99_CHOICE(tag, ...) (tag, __VA_ARGS__)
#define ML99_CHOICE_TAG(choice) ML99_PRIV_HEAD_AUX choice
#define ML99_CHOICE_DATA(choice) ML99_PRIV_TAIL_AUX choice
#ifndef DOXYGEN_IGNORE
#define ML99_choice_IMPL(tag, ...) v(ML99_CHOICE(tag, __VA_ARGS__))
#define ML99_choiceTag_IMPL(choice) v(ML99_CHOICE_TAG(choice))
#define ML99_choiceData_IMPL(choice) v(ML99_CHOICE_DATA(choice))
#define ML99_match_IMPL(choice, matcher) \
ML99_callUneval(ML99_PRIV_CAT(matcher, ML99_PRIV_HEAD_AUX choice), ML99_PRIV_TAIL_AUX choice)
#define ML99_matchWithArgs_IMPL(choice, matcher, ...) \
ML99_callUneval( \
ML99_PRIV_CAT(matcher, ML99_PRIV_HEAD_AUX choice), \
ML99_PRIV_TAIL_AUX choice, \
__VA_ARGS__)
// Arity specifiers {
#define ML99_choice_ARITY 2
#define ML99_choiceTag_ARITY 1
#define ML99_choiceData_ARITY 1
#define ML99_match_ARITY 2
#define ML99_matchWithArgs_ARITY 3
// } (Arity specifiers)
#endif // DOXYGEN_IGNORE
#endif // ML99_CHOICE_H
lang.h
The core metalanguage.