NAME
Language::MuldisD::Ext::Sequence - Muldis D extension for Seq specific operators
VERSION
This document is Language::MuldisD::Ext::Sequence version 0.20.0.
PREFACE
This document is part of the Muldis D language specification, whose root document is Language::MuldisD; 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 Sequence document describes the system-defined Muldis D Sequence Extension, which consists of generic operators that are specific to the Seq parameterized 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 Language::MuldisD::Core.
This documentation is pending.
SYSTEM-DEFINED SEQUENCE-CONCERNING FUNCTIONS
function sys.Sequence.Seq.value result ScaTupRel params { topic(Seq), index(UInt) }-
This function results in the scalar or nonscalar
valueattribute of the tuple oftopicwhoseindexattribute isindex. This function will fail if no tuple exists intopicwith the specified index. function sys.Sequence.Seq.update_value result Seq params { topic(Seq), index(UInt), value(ScaTupRel) }-
This function results in its
topicargument but that thevalueattribute of the tuple oftopicwhoseindexattribute isindexhas been updated with a new scalar or nonscalar value given byvalue. This function will fail if no tuple exists intopicwith the specified index, or if the declared type ofvalueisn't a subtype of the declared type of thevalueattribute. function sys.Sequence.Seq.insertion result Seq params { topic(Seq), index(UInt), value(ScaTupRel) }-
This function results in its
topicargument but that a new tuple has been inserted whoseindexisindexand whosevalueisvalue; any existing tuples withindexvalues greater than or equal toindexhad theirs incremented by 1. As a trivial case, ifindexis equal to zero or is equal to the cardinality oftopic, thenvaluehas become the new first or last (or only) element, respectively. This function will fail ifindexis greater than the cardinality oftopic, or if the declared type ofvalueisn't a subtype of the declared type of thevalueattribute. function sys.Sequence.Seq.deletion result Seq params { topic(Seq), index(UInt) }-
This function results in its
topicargument but that a tuple has been deleted whoseindexisindex; any existing tuples withindexvalues greater than or equal toindexhad theirs decremented by 1. This function will fail if no tuple exists intopicwith the specified index. function sys.Sequence.Seq.is_element result Bool params { topic(Seq), value(ScaTupRel) }-
This function results in
Bool:trueiff itsvalueargument matches thevalueattribute of at least one tuple of itstopicargument (that is, iff conceptuallyvalueis an element oftopic), andBool:falseotherwise. This function will fail if the declared type ofvalueisn't a subtype of the declared type of that attribute. function sys.Sequence.Seq.is_not_element result Bool params { topic(Seq), value(ScaTupRel) }-
This function is exactly the same as
sys.Sequence.Seq.is_elementexcept that it results in the opposite boolean value when given the same arguments. function sys.Sequence.Seq.reduction result ScaTupRel params { topic(Seq), func(Cat.NameChain), assuming(Tuple), identity(ScaTupRel) }-
This function is the same as
sys.Set.Set.reduction, including that input values for the reduction come from thevalueattribute oftopic, except that it works with aSeqrather than aSet. Also, the function named infuncis only associative, and not commutative; the arguments tov1andv2offuncare guaranteed to be consecutive input elements, with the result returning to their place in sequence beween the other input elements. function sys.Sequence.Seq.maybe_reduction result Maybe params { topic(Seq), func(Cat.NameChain), assuming(Tuple) }-
This function is to
sys.Set.Set.maybe_reductionassys.Sequence.Seq.reductionis tosys.Set.Set.reduction. function sys.Sequence.Seq.catenation result Seq params { topic(SeqOfSeq) }-
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
Seqmeans to union their tuples after first increasing all theindexvalues of the second one by the cardinality of the first one. Iftopichas zero values, thencatenateresults in the empty sequence value, which is the identity value for catenate. function sys.Sequence.Seq.repeat result Seq params { topic(Seq), count(UInt) }-
This function results in the catenation of
countinstances oftopic. function sys.Sequence.Seq.reverse result Seq params { topic(Seq) }-
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' }. function sys.Sequence.Seq.is_subseq result Bool params { look_in(Seq), look_for(Seq) }-
This function results in
Bool:trueiff the sequence of values comprisinglook_foris a sub-sequence of the sequence of valueslook_in, andBool:falseotherwise. This function will fail if the 2 arguments don't have the same heading. function sys.Sequence.Seq.is_not_subseq result Bool params { look_in(Seq), look_for(Seq) }-
This function is exactly the same as
sys.Sequence.Seq.is_subseqexcept that it results in the opposite boolean value when given the same arguments.
SEE ALSO
Go to Language::MuldisD for the majority of distribution-internal references, and Language::MuldisD::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-2008, Darren Duncan.
See the LICENSE AND COPYRIGHT of Language::MuldisD for details.
ACKNOWLEDGEMENTS
The ACKNOWLEDGEMENTS in Language::MuldisD apply to this file too.