Boolean algebra.
More...
Go to the source code of this file.
|
| #define | ML99_true(...) |
| | Truth.
|
| #define | ML99_false(...) |
| | Falsehood.
|
| #define | ML99_not(x) |
| | Logical negation.
|
| #define | ML99_and(x, y) |
| | Logical conjunction.
|
| #define | ML99_or(x, y) |
| | Logical inclusive OR.
|
| #define | ML99_xor(x, y) |
| | Logical exclusive OR.
|
| #define | ML99_boolEq(x, y) |
| | Tests x and y for equality.
|
| #define | ML99_boolMatch(x, matcher) |
| | Matches x against the two cases: if it is 0 or 1.
|
| #define | ML99_boolMatchWithArgs(x, matcher, ...) |
| | The same as ML99_boolMatch but provides additional arguments to all branches.
|
| #define | ML99_if(cond, x, y) |
| | If cond is true, evaluates to x, otherwise y.
|
| #define | ML99_IF(cond, x, y) |
| | The plain version of ML99_if.
|
| #define | ML99_TRUE(...) |
| #define | ML99_FALSE(...) |
| #define | ML99_NOT(x) |
| #define | ML99_AND(x, y) |
| #define | ML99_OR(x, y) |
| #define | ML99_XOR(x, y) |
| #define | ML99_BOOL_EQ(x, y) |
◆ ML99_AND
| #define ML99_AND |
( |
| x, |
|
|
| y ) |
◆ ML99_and
| #define ML99_and |
( |
| x, |
|
|
| y ) |
Value:
#define ML99_and(x, y)
Logical conjunction.
Definition bool.h:62
#define ML99_call(op,...)
Invokes a metafunction with arguments.
Definition lang.h:33
Logical conjunction.
Examples
#define v(...)
A value that is pasted as-is; no evaluation occurs on provided arguments.
Definition lang.h:145
◆ ML99_BOOL_EQ
| #define ML99_BOOL_EQ |
( |
| x, |
|
|
| y ) |
◆ ML99_boolEq
| #define ML99_boolEq |
( |
| x, |
|
|
| y ) |
Value:
#define ML99_boolEq(x, y)
Tests x and y for equality.
Definition bool.h:130
Tests x and y for equality.
Examples
◆ ML99_boolMatch
| #define ML99_boolMatch |
( |
| x, |
|
|
| matcher ) |
Value:
#define ML99_boolMatch(x, matcher)
Matches x against the two cases: if it is 0 or 1.
Definition bool.h:153
Matches x against the two cases: if it is 0 or 1.
Examples
#define MATCH_1_IMPL() v(Billie)
#define MATCH_0_IMPL() v(Jean)
- Note
- This function calls
f with ML99_call, so no partial application occurs, and so arity specifiers are not needed.
◆ ML99_boolMatchWithArgs
| #define ML99_boolMatchWithArgs |
( |
| x, |
|
|
| matcher, |
|
|
| ... ) |
Value:
#define ML99_boolMatchWithArgs(x, matcher,...)
The same as ML99_boolMatch but provides additional arguments to all branches.
Definition bool.h:173
The same as ML99_boolMatch but provides additional arguments to all branches.
Examples
#define MATCH_1_IMPL(x, y, z) v(Billie ~ x y z)
#define MATCH_0_IMPL(x, y, z) v(Jean ~ x y z)
◆ ML99_FALSE
| #define ML99_FALSE |
( |
| ... | ) |
|
◆ ML99_false
| #define ML99_false |
( |
| ... | ) |
|
Value:
#define ML99_false(...)
Falsehood.
Definition bool.h:22
#define ML99_callUneval(ident,...)
Invokes a metafunction ident with unevaluated arguments.
Definition lang.h:42
Falsehood.
◆ ML99_IF
| #define ML99_IF |
( |
| cond, |
|
|
| x, |
|
|
| y ) |
Value:ML99_PRIV_UNTUPLE(ML99_PRIV_IF(cond, (x), (y)))
The plain version of ML99_if.
This macro can imitate lazy evaluation: ML99_IF(<cond>, <term>, <another-term>) will expand to one of the two terms, which can be evaluated further; if <cond> is 0, then <term> will not be evaluated, and the same with <another-term>.
- Note
x and y can possibly expand to commas. It means that you can supply ML99_TERMS(...) as a branch, for example.
◆ ML99_if
| #define ML99_if |
( |
| cond, |
|
|
| x, |
|
|
| y ) |
Value:
#define ML99_if(cond, x, y)
If cond is true, evaluates to x, otherwise y.
Definition bool.h:191
If cond is true, evaluates to x, otherwise y.
Examples
◆ ML99_NOT
◆ ML99_not
Value:
#define ML99_not(x)
Logical negation.
Definition bool.h:39
Logical negation.
Examples
◆ ML99_OR
◆ ML99_or
Value:
#define ML99_or(x, y)
Logical inclusive OR.
Definition bool.h:84
Logical inclusive OR.
Examples
◆ ML99_TRUE
◆ ML99_true
Value:
#define ML99_true(...)
Truth.
Definition bool.h:17
Truth.
◆ ML99_XOR
| #define ML99_XOR |
( |
| x, |
|
|
| y ) |
◆ ML99_xor
| #define ML99_xor |
( |
| x, |
|
|
| y ) |
Value:
#define ML99_xor(x, y)
Logical exclusive OR.
Definition bool.h:107
Logical exclusive OR.
Examples