NAME
Language::MuldisD::Ext::Blob - Muldis D extension for bit string data types and operators
VERSION
This document is Language::MuldisD::Ext::Blob 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 Blob
document describes the system-defined Muldis D Blob Extension, which consists of undifferentiated bit string data types and operators, essentially all the generic ones that a typical programming language should have, but for the bare minimum needed for bootstrapping Muldis D, which are defined in the language core instead.
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.
TYPE SUMMARY
Following are all the data types described in this document, arranged in a type graph according to their proper sub|supertype relationships (but that a few of them just reappear from the core set to provide a similar context, and aren't re-described here):
sys.Core.Universal.Universal
sys.Core.Universal.Empty
sys.Core.Scalar.Scalar
sys.Core.Scalar.Int
sys.Core.Scalar.UInt
sys.Core.Scalar.PInt
# These are all integer types.
sys.Blob.Cat.PInt1_4
Also for convenience are the regular set|maybe|seq|bag types sys.Blob.Spec.(Set|Maybe|Seq|Bag)OfBlob
.
This documentation is pending.
SYSTEM-DEFINED BLOB-CONCERNING DATA TYPES
sys.Blob.Cat.PInt1_4
A Cat.PInt1_4
is a proper subtype of PInt
where all member values are between 1 and 4. Its maximum value is 4. The cardinality of this type is 4.
sys.Blob.Spec.(Set|Maybe|Seq|Bag)OfBlob
-
A
(Set|Maybe|Seq|Bag)OfBlob
is a completely defined proper subtype of(Set|Maybe|Seq|Bag)
whosevalue
attribute has a declared type of aBlob
subtype.
SYSTEM-DEFINED BLOB-CONCERNING FUNCTIONS
These functions implement commonly used binary string operations.
function sys.Blob.Blob.catenation result Blob params { topic(SeqOfBlob) }
-
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. If
topic
has zero values, thencatenate
results in the empty string value, which is the identity value for catenate. function sys.Blob.Blob.repeat result Blob params { topic(Blob), count(UInt) }
-
This function results in the catenation of
count
instances oftopic
. function sys.Blob.Blob.length_in_bits result UInt params { topic(Blob) }
-
This function results in the length of its argument in bits.
function sys.Blob.Blob.is_substr result Bool params { look_in(Blob), look_for(Blob), fixed_start(Bool), fixed_end(Bool) }
-
This function results in
Bool:true
iff itslook_for
argument is a substring of itslook_in
argument as per the optionalfixed_start
andfixed_end
constraints, andBool:false
otherwise. Iffixed_start
orfixed_end
areBool:true
, thenlook_for
must occur right at the start or end, respectively, oflook_in
in order forcontains
to results inBool:true
; if either flag isBool:false
, its additional constraint doesn't apply. function sys.Blob.Blob.is_not_substr result Bool params { look_in(Blob), look_for(Blob), fixed_start(Bool), fixed_end(Bool) }
-
This function is exactly the same as
sys.Blob.Blob.is_substr
except that it results in the opposite boolean value when given the same arguments. function sys.Blob.Blob.not result Blob params { topic(Blob) }
-
This function results in the bitwise not of its argument.
function sys.Blob.Blob.and result Blob params { topic(SetOfBlob) }
-
This function is a reduction operator that recursively takes each pair of its N input element values and does a bitwise and (which is both commutative and associative) on them until just one is left, which is the function's result. This function's argument values must all be of the same length in bits, that length being part of the argument's declared type (that is,
Blob
subtype) definition, and that is also the length in bits of the function's result. Iftopic
has zero values, thenand
will result in an appropriate-length string of identity/1 valued bits. function sys.Blob.Blob.or result Blob params { topic(SetOfBlob) }
-
This function is the same as
sys.Blob.Blob.and
but that it recursively does a bitwise inclusive-or rather than a bitwise and, and its identity value is composed of zero valued bits. function sys.Blob.Blob.xor result Blob params { topic(BagOfBlob) }
-
This function is the same as
sys.Blob.Blob.or
but that it recursively does a bitwise exclusive-or rather than a bitwise inclusive-or.
These functions convert between Blob
values and canonically formatted representations of binary strings as character strings.
function sys.Blob.Blob.Blob_from_Text result Blob params { text(Text), size(Cat.PInt1_4) }
-
This selector function results in the
Blob
value that itstext
argument maps to when each input character represents a sequence of 1-4 bits, the number of bits per character being determined by thesize
argument; for example, ifsize
is 1, then each input character is a [0-1] and represents a bit; or, ifsize
is 4, then each input character is a [0-9A-F] and represents 4 bits. This function will fail iftext
can't be mapped as specified. function sys.Blob.Blob.Text_from_Blob result Text params { blob(Blob), size(Cat.PInt1_4) }
-
This selector function results in the
Text
value where its argument is encoded using a character for each sequence of 1-4 bits, the number of bits per character being determined by thesize
argument. This function will fail ifblob
doesn't have a length in bits which is a multiple ofsize
.
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.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 75:
'=item' outside of any '=over'
- Around line 81:
You forgot a '=back' before '=head1'