NAME
Muldis::D::Ext::QTuple - Muldis D extension adding more generic q/tuple operators
VERSION
This document is Muldis::D::Ext::QTuple version 0.62.0.
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 QTuple
document describes the system-defined Muldis D QTuple Extension, which consists of extra operators for generic q/tuples, adding to the minimum few defined 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 GENERIC QUASI-/TUPLE-CONCERNING FUNCTIONS
These functions are applicable to mainly q/tuple types, but are generic in that they typically work with any q/tuple types.
sys.std.QTuple.degree
function sys.std.QTuple.degree result NNInt params { topic(QTuple) }
This function results in the degree of its argument (that is, the count of attributes it has).
sys.std.QTuple.is_nullary
function sys.std.QTuple.is_nullary result Bool params { topic(QTuple) }
This function results in Bool:true
iff its argument has a degree of zero (that is, it has zero attributes), and Bool:false
otherwise. By definition, the only 1 q/tuple value for which this function would result in Bool:true
is the only member of the type TupleD0
.
sys.std.QTuple.is_not_nullary
function sys.std.QTuple.is_not_nullary result Bool params { topic(QTuple) }
This function is exactly the same as sys.std.QTuple.is_nullary
except that it results in the opposite boolean value when given the same argument.
sys.std.QTuple.has_attrs
function sys.std.QTuple.has_attrs result Bool params { topic(QTuple), attr_names(set_of.Name) }
This function results in Bool:true
iff, for every one of the attribute names specified by its attr_names
argument, its topic
argument has an attribute with that name; otherwise it results in Bool:false
. As a trivial case, this function's result is Bool:true
if attr_names
is empty.
sys.std.QTuple.attr_names
function sys.std.QTuple.attr_names result set_of.Name params { topic(QTuple) }
This function results in the set of the names of the attributes of its argument.
sys.std.QTuple.attr_from_QTuple
function sys.std.QTuple.attr_from_QTuple result Universal params { topic(QTuple) }
This function results in the q/scalar or q/nonscalar value of the sole attribute of its argument. This function will fail if its argument is not of degree 1.
sys.std.QTuple.QTuple_from_attr
function sys.std.QTuple.QTuple_from_attr result QTuple params { name(Name), value(Universal) }
This function results in the QTuple
value which has just one attribute whose name is given by name
and whose value is given by value
.
sys.std.QTuple.subst_in_default
function sys.std.QTuple.subst_in_default result QTuple params { of(TypeRef), subst(QTuple) }
This function results in the q/tuple value that is the default value of the q/tuple data type whose name is given in the of
argument, but that zero or more of its attribute values have been substituted by values given in the subst
argument. This function is a short-hand for sys.std.Core.QTuple.multi_update
on the result of sys.std.Core.Universal.default
. This function will fail if either default
would fail for the same of
argument, or if its result isn't a q/tuple type, or if the heading of subst
isn't a subset of the heading of the default. The purpose of this function is to support greater brevity in Muldis D coding such that users can define just part of a desired q/tuple value and have the remainder filled in from defaults for them; particularly useful with q/tuples that conceptually have some optional attributes.
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.