|
Metalang99 1.13.5
Full-blown preprocessor metaprogramming
|
Tuples: (x, y, z). More...

Go to the source code of this file.
Macros | |
| #define | ML99_tuple(...) |
| Transforms a sequence of arguments into (...). | |
| #define | ML99_tupleEval(...) |
| Transforms a sequence of arguments into (v(...)). | |
| #define | ML99_untuple(x) |
Untuples the tuple x, leaving the result unevaluated. | |
| #define | ML99_untupleChecked(x) |
| The same as ML99_untuple. | |
| #define | ML99_untupleEval(x) |
Untuples the tuple x and evaluates the result. | |
| #define | ML99_isTuple(x) |
Tests whether x is inside parentheses or not. | |
| #define | ML99_isUntuple(x) |
| The inverse of ML99_isTuple. | |
| #define | ML99_tupleCount(x) |
Computes the count of items in the tuple x. | |
| #define | ML99_tupleIsSingle(x) |
Tells if the tuple x contains only one item or not. | |
| #define | ML99_tupleGet(i) |
Expands to a metafunction extracting the i -indexed element of a tuple. | |
| #define | ML99_tupleTail(x) |
| Extracts the tuple's tail. | |
| #define | ML99_tupleAppend(x, ...) |
Appends provided variadic arguments to the tuple x. | |
| #define | ML99_tuplePrepend(x, ...) |
Prepends provided variadic arguments to the tuple x. | |
| #define | ML99_tupleForEach(f, x) |
| A shortcut for ML99_variadicsForEach(f, ML99_untuple(x)). | |
| #define | ML99_tupleForEachI(f, x) |
| A shortcut for ML99_variadicsForEachI(f, ML99_untuple(x)). | |
| #define | ML99_assertIsTuple(x) |
Emits a fatal error if x is not a tuple, otherwise results in emptiness. | |
| #define | ML99_TUPLE(...) |
| #define | ML99_UNTUPLE(x) |
| #define | ML99_IS_TUPLE(x) |
| #define | ML99_IS_UNTUPLE(x) |
| #define | ML99_TUPLE_COUNT(x) |
| #define | ML99_TUPLE_IS_SINGLE(x) |
| #define | ML99_TUPLE_GET(i) |
| #define | ML99_TUPLE_TAIL(x) |
| #define | ML99_TUPLE_APPEND(x, ...) |
| #define | ML99_TUPLE_PREPEND(x, ...) |
Tuples: (x, y, z).
A tuple is represented as (x1, ..., xN). Tuples are a convenient way to deal with product types. For example:
| #define ML99_assertIsTuple | ( | x | ) |
Emits a fatal error if x is not a tuple, otherwise results in emptiness.
| #define ML99_IS_TUPLE | ( | x | ) |
| #define ML99_IS_UNTUPLE | ( | x | ) |
| #define ML99_isTuple | ( | x | ) |
Tests whether x is inside parentheses or not.
The preconditions are the same as of ML99_isUntuple.
| #define ML99_isUntuple | ( | x | ) |
The inverse of ML99_isTuple.
x must be either of these forms:
For example (respectively):
| #define ML99_TUPLE | ( | ... | ) |
| #define ML99_tuple | ( | ... | ) |
Transforms a sequence of arguments into (...).
| #define ML99_TUPLE_APPEND | ( | x, | |
| ... ) |
| #define ML99_TUPLE_COUNT | ( | x | ) |
| #define ML99_TUPLE_GET | ( | i | ) |
| #define ML99_TUPLE_IS_SINGLE | ( | x | ) |
| #define ML99_TUPLE_PREPEND | ( | x, | |
| ... ) |
| #define ML99_TUPLE_TAIL | ( | x | ) |
| #define ML99_tupleAppend | ( | x, | |
| ... ) |
Appends provided variadic arguments to the tuple x.
| #define ML99_tupleCount | ( | x | ) |
Computes the count of items in the tuple x.
At most 63 items can be contained in x.
| #define ML99_tupleEval | ( | ... | ) |
Transforms a sequence of arguments into (v(...)).
| #define ML99_tupleForEach | ( | f, | |
| x ) |
A shortcut for ML99_variadicsForEach(f, ML99_untuple(x)).
| #define ML99_tupleForEachI | ( | f, | |
| x ) |
A shortcut for ML99_variadicsForEachI(f, ML99_untuple(x)).
| #define ML99_tupleGet | ( | i | ) |
Expands to a metafunction extracting the i -indexed element of a tuple.
i can range from 0 to 7, inclusively.
| #define ML99_tupleIsSingle | ( | x | ) |
Tells if the tuple x contains only one item or not.
| #define ML99_tuplePrepend | ( | x, | |
| ... ) |
Prepends provided variadic arguments to the tuple x.
| #define ML99_tupleTail | ( | x | ) |
Extracts the tuple's tail.
x must contain at least two elements.
| #define ML99_UNTUPLE | ( | x | ) |
| #define ML99_untuple | ( | x | ) |
Untuples the tuple x, leaving the result unevaluated.
If x is not a tuple, it emits a fatal error.
| #define ML99_untupleChecked | ( | x | ) |
| #define ML99_untupleEval | ( | x | ) |
Untuples the tuple x and evaluates the result.