@head
@title Tuple operations
These operations are provided for working with tuple objects. Only the most
commonly needed operations are supported. Generic operations such as
@ref{AIterator} and @ref{AIn} can be used as well to perform additional
operations.
Creating
@fun AValue AMakeTuple(AThread *t, Assize_t len)
@desc Create a std::Tuple object of the specified length. The object
is initialized to contain nil values for all items.
Use @ref{AInitTupleItem} immediately to initilize the tuple.
@note You must
not use partially initialized tuple objects for any other purpose than
for initializing them. In particular, you must not return them from
functions, assign them to non-local variables or pass them as
arguments to functions or operations.
@end
@end
Reading and updating
@fun Assize_t ATupleLen(AValue v)
@desc Return the length of a tuple. The argument must be a std::Tuple
object. This function performs no error checking.
@end
@fun AValue ATupleItem(AValue v, Assize_t index)
@desc Return the value of an item in a tuple. The first argument must be a
std::Tuple object, and the index (0-based) must be non-negative
and less than the length of the tuple. This function performs no
error checking.
@end
@fun void AInitTupleItem(AThread *t, AValue v, Assize_t index, AValue item)
@desc Initialize the value of an item in a tuple. The second argument must
be a newly allocated
std::Tuple object that is not visible to any Alore code,
and the index (0-based) must be non-negative
and less than then length of the tuple. This function performs
no error checking of the argument values. Raise a direct exception if
out of memory.
@end
Checking
@fun ABool AIsTuple(AValue v)
@desc Return a boolean indicating whether the type of v is std::Tuple.
@end