NAME

Muldis::D::Ext::QArray - Muldis D extension for QArray specific operators

VERSION

This document is Muldis::D::Ext::QArray version 0.62.3.

PREFACE

This document is part of the Muldis D language specification, whose root document is Muldis::D; you should read that root document before you read this one, which provides subservient details.

DESCRIPTION

Muldis D has a mandatory core set of system-defined (eternally available) entities, which is referred to as the Muldis D core or the core; they are the minimal entities that all Muldis D implementations need to provide; they are mutually self-describing and are used to bootstrap the language; any entities outside the core, called Muldis D extensions, are non-mandatory and are defined in terms of the core or each other, but the reverse isn't true.

This current QArray document describes the system-defined Muldis D QArray Extension, which consists of generic operators that are specific to the QArray parameterized q/relation type, and said operators are short-hands for generic relational operators in the language core.

This current document does not describe the polymorphic operators that all types, or some types including core types, have defined over them; said operators are defined once for all types in Muldis::D::Core.

This documentation is pending.

SYSTEM-DEFINED QUASI-/ARRAY-CONCERNING FUNCTIONS

Each \w*assuming parameter is optional and defaults to the zero-attribute tuple if no explicit argument is given to it.

sys.std.QArray.value

function sys.std.QArray.value (Universal <-- QArray $topic, NNInt $index)

This function results in the q/scalar or q/nonscalar value attribute of the q/tuple of topic whose index attribute is index. This function will fail if no q/tuple exists in topic with the specified index.

sys.std.QArray.update_value

function sys.std.QArray.update_value (QArray <-- QArray $topic, NNInt $index, Universal $value)

This function results in its topic argument but that the value attribute of the q/tuple of topic whose index attribute is index has been updated with a new q/scalar or q/nonscalar value given by value. This function will fail if no q/tuple exists in topic with the specified index. This function will warn if the most specific types of the value argument and the value attribute of topic are incompatible as per is_identical, or otherwise if the declared type of value isn't a subtype of the declared type of the value attribute.

sys.std.QArray.insertion

function sys.std.QArray.insertion (QArray <-- QArray $topic, NNInt $index, Universal $value)

This function results in its topic argument but that a new q/tuple has been inserted whose index is index and whose value is value; any existing q/tuples with index values greater than or equal to index had theirs incremented by 1. As a trivial case, if index is equal to zero or is equal to the cardinality of topic, then value has become the new first or last (or only) element, respectively. This function will fail if index is greater than the cardinality of topic, or it will warn if topic.value and value are incompatible as per update_value.

sys.std.QArray.deletion

function sys.std.QArray.deletion (QArray <-- QArray $topic, NNInt $index)

This function results in its topic argument but that a q/tuple has been deleted whose index is index; any existing q/tuples with index values greater than or equal to index had theirs decremented by 1. This function will fail if no q/tuple exists in topic with the specified index.

sys.std.QArray.is_element

function sys.std.QArray.is_element (Bool <-- QArray $topic, Universal $value)

This function results in Bool:true iff its value argument matches the value attribute of at least one q/tuple of its topic argument (that is, iff conceptually value is an element of topic), and Bool:false otherwise. This function will warn if topic.value and value are incompatible as per update_value.

sys.std.QArray.is_not_element

function sys.std.QArray.is_not_element (Bool <-- QArray $topic, Universal $value)

This function is exactly the same as sys.std.QArray.is_element except that it results in the opposite boolean value when given the same arguments.

sys.std.QArray.reduction

function sys.std.QArray.reduction (Universal <-- QArray $topic, FuncRef $func, QTuple $assuming?, Universal $identity)

This function is the same as sys.std.QSet.reduction, including that input values for the reduction come from the value attribute of topic, except that it works with an QArray rather than a QSet. Also, the function named in func is only associative, and not commutative; the arguments to v1 and v2 of func are guaranteed to be consecutive input elements, with the result returning to their place in sequence beween the other input elements.

sys.std.QArray.maybe_reduction

function sys.std.QArray.maybe_reduction (QMaybe <-- QArray $topic, FuncRef $func, QTuple $assuming?)

This function is to sys.std.QSet.maybe_reduction as sys.std.QArray.reduction is to sys.std.QSet.reduction.

sys.std.QArray.slice

function sys.std.QArray.slice (QArray <-- QArray $topic, NNInt $first_index, NNInt $last_index)

This function results in the sub-sequence of its topic argument that is specified by its first_index and last_index arguments, which specify the inclusive source-index range of the elements of the result. This function will fail if last_index is before first_index. It is valid for first_index or last_index to be greater than the last index of topic; in the first case, the result has zero elements; in the second case, the result has all remaining elements starting at first_index. If topic has any elements and first_index matches the index of a source element, then the result will always have at least 1 element.

sys.std.QArray.catenation

function sys.std.QArray.catenation (QArray <-- quasi_array_of.QArray $topic)

This function results in the catenation of the N element values of its argument; it is a reduction operator that recursively takes each consecutive pair of input values and catenates (which is associative) them together until just one is left, which is the result. To catenate 2 QArray means to union their q/tuples after first increasing all the index values of the second one by the cardinality of the first one. If topic has zero values, then catenate results in the empty sequence value, which is the identity value for catenate.

sys.std.QArray.repeat

function sys.std.QArray.repeat (QArray <-- QArray $topic, NNInt $count)

This function results in the catenation of count instances of topic.

sys.std.QArray.reverse

function sys.std.QArray.reverse (QArray <-- QArray $topic)

This function results in its argument but that the order of its elements has been reversed. For example, the input { 0=>'a', 1=>'b', 2=>'c', 3=>'d'} results in { 0=>'d', 1=>'c', 2=>'b', 3=>'a' }.

sys.std.QArray.is_subarray

function sys.std.QArray.is_subarray (Bool <-- QArray $look_in, QArray $look_for)

This function results in Bool:true iff the sequence of values comprising look_for is a sub-sequence of the sequence of values look_in, and Bool:false otherwise. This function will fail|warn if the 2 arguments don't have a compatible or same heading.

sys.std.QArray.is_not_subarray

function sys.std.QArray.is_not_subarray (Bool <-- QArray $look_in, QArray $look_for)

This function is exactly the same as sys.std.QArray.is_subarray except that it results in the opposite boolean value when given the same arguments.

sys.std.QArray.QArray_from_wrap

function sys.std.QArray.QArray_from_wrap (quasi_array_of.QTuple <-- QRelation $topic, FuncRef $ord_func, QTuple $ord_assuming?)

This function results in an QArray whose value attribute is q/tuple-typed and that attribute's values are all the q/tuples of topic; is a short-hand for a relational wrap of all attributes of topic such that the new q/tuple-valued attribute is named value, and then that result is extended with an index attribute whose values result from a rank of the q/tuples, where the ranked-first q/tuple has an index of zero, and so on. This function is a wrapper over the (total) order_determination function named in its ord_func argument when the latter function is curried by its ord_assuming argument; this wrapped function is used to rank the q/tuples, with each invocation getting a topic q/tuple as each its topic and other arguments. See also the sys.std.QRelation.rank function, which is the same as sys.std.QArray.QArray_from_wrap but that it just adds an attribute to the source q/tuples and does not wrap them.

sys.std.QArray.limit_of_QArray_from_wrap

function sys.std.QArray.limit_of_QArray_from_wrap (quasi_array_of.QTuple <-- QRelation $topic, FuncRef $ord_func, QTuple $ord_assuming?, NNInt $first_index, NNInt $last_index)

This function is a short-hand for invoking first sys.std.QArray.QArray_from_wrap and then sys.std.QArray.slice on its result. This function is to sys.std.QArray.QArray_from_wrap what the sys.std.QRelation.limit function is to sys.std.QRelation.rank.

sys.std.QArray.QArray_from_attr

function sys.std.QArray.QArray_from_attr (QArray <-- QRelation $topic, Name $name, OrdDetFuncRef $ord_func?, QTuple $ord_assuming?)

This function results in an QArray consisting of all the values of the attribute of topic named by name. It is a short-hand for a unary projection of just the named attribute plus its renaming to value, and then that result is extended with an index attribute whose values result from a rank of the source attribute values, where the ranked-first source value has an index of zero, and so on. This function is otherwise the same as sys.std.QArray.QArray_from_wrap. Each of the ord_func and ord_assuming parameters is optional and defaults to sys.std.Core.QScalar.order or the zero-attribute tuple, respectively, if no explicit argument is given to it.

SEE ALSO

Go to Muldis::D for the majority of distribution-internal references, and Muldis::D::SeeAlso for the majority of distribution-external references.

AUTHOR

Darren Duncan (perl@DarrenDuncan.net)

LICENSE AND COPYRIGHT

This file is part of the formal specification of the Muldis D language.

Muldis D is Copyright © 2002-2009, Muldis Data Systems, Inc.

See the LICENSE AND COPYRIGHT of Muldis::D for details.

TRADEMARK POLICY

The TRADEMARK POLICY in Muldis::D applies to this file too.

ACKNOWLEDGEMENTS

The ACKNOWLEDGEMENTS in Muldis::D apply to this file too.