NAME

Muldis::D::Ext::Tuple - Muldis D extension adding more generic tuple operators

VERSION

This document is Muldis::D::Ext::Tuple version 0.25.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 Tuple document describes the system-defined Muldis D Tuple Extension, which consists of extra operators for generic 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 TUPLE-CONCERNING FUNCTIONS

These functions are applicable to mainly tuple types, but are generic in that they typically work with any tuple types.

function sys.std.Tuple.degree result UInt params { topic(Tuple) }

This function results in the degree of its argument (that is, the count of attributes it has).

function sys.std.Tuple.attr_from_Tuple result ScaTupRel params { topic(Tuple) }

This function results in the scalar or nonscalar value of the sole attribute of its argument. This function will fail if its argument is not of degree 1.

function sys.std.Tuple.Tuple_from_attr result Tuple params { name(Cat.Name), value(ScaTupRel) }

This function results in the Tuple value which has just one attribute whose name is given by name and whose value is given by value.

function sys.std.Tuple.substitution_in_default result Tuple params { of(Cat.TypeRef), subst(Tuple) }

This function results in the tuple value that is the default value of the 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.Tuple.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 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 tuple value and have the remainder filled in from defaults for them; particularly useful with 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-2008, Darren Duncan.

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.