Type
(0)
Type
...is a frequently used prefix or suffix keyword modifier.
Type[expr]
...returns the DataType of expr.
Similarly...
Stream[n][Type]
...is the DataType of Stream[n]’s elements.
Type[Name] is assigned to the Set of all DataType Names.
If type is the Name of a DataType, then...
Type[type][Function]
...is assigned to the Function which converts binary code
into the type’s value. See TypeNameFunction.
Type[Cardinal][(streamObject/dataType)]
returns the TypeSize (byte size) of (streamObject/dataType).
Type[subNam, patternSet] declares the substitution name subNam.
Type[_,_]-constructs are used in elicitation forms like the following...
Name[nam[Type[v1, patternSet],
Type[v2, patternSet],...],
eval]
The substitution name form, (using Standard ASCII RuleList operators),...
arg__
...matches any sequence (and is short for Type[arg, Pattern[Sequence]]).
The substitution name form,
arg__head
...matches expressions with head (and is short for Type[arg, Pattern[Type[head]][Sequence]]).
Both “arg__” and “arg__head”
are TypePatternSequences.
Type[arg, Branch[...patN, doN, ...]] (a.k.a. TypeBranch)
...is a dedicated branching substitution name mechanism for elicitation forms.
See English Definition of “type”.
(1)
Type[expr]
...returns the DataType
of expr. For example,
Type[Stream[n]]
...returns Stream.
Some objects have a DataType
field. The StreamObject is an example. Each element
in a Stream has the same DataType.
If "Stream[n]" is a StreamObject, then...
(2)
Stream[n][Type]
...returns the DataType of Stream[n]’s
elements.
If the Type returned by (2) is Stream, then its elements are treated as a series of bytes (without any interpretation).
If the Type returned by (2) is String, then its elements are Characters which are represented as one
or more bytes. See CharacterStream and RuleList.
(3)
Type[Name]
...is assigned to the Set of all DataType Names.
If type is the Name of a DataType, (Type[Name][type] is True), and substance is
the BinaryString for type,
then...
(4) Type[type][Function][substance]
...converts the BinaryString, substance,
into the type’s value as a handle to an ExpressionAtom. If the substance is
not interpretable, no memory is assigned and, False is returned. If the value
assignment "should" work but fails nonetheless, something with the
form...
Noop[type[...]]
...is returned. If "Noop[type[...]]"
is assigned to alternate procedures that generate handles to type's
ExpressionAtoms, then the execution of an
alternate procedure will be the result of (4). (If the elicitation, "Noop[type[...]]" is
assigned, then it also has the Noop attribute so that the alternate
procedure may be selectively enabled. "Noop[type[...]]" is
sometimes a diagnostic message, and sometimes an elicited function.)
Type[type][Function]
...takes a BinaryString as input and
returns Noop[type[...]], False, or a handle to substance.
See the source code for Reckon[Expression[Branch]] for details of
how (4) is used when a String is Reckoned as an expression.
The Function returned by (4) is called the TypeNameFunction.
In the case of “Name[substance]”,
for example, “substance” is either a recognized Name or it is created.
Type[Name][Function]
is assigned to the Function that executes this Name-recognition.
This Function takes input, (a BinaryString), and returns a handle if the input
is interpretable as a Name.
If the input BinaryString is not interpretable
as a Name, False is returned.
(5)
Type[Cardinal][streamObject]
...returns the number of bytes in the current element of
streamObject (a StreamObject).
Similarly, if dataType is a DataType,
Type[Cardinal][dataType]
...returns the number of bytes in the StreamObject, dataType.
All multiple argument Type[_,
__] elicitations are called substitution name constructs.
These Type[_, __] constructs are
part of most elicitations. The literal substitution names are not real
Names; they are lexical devices for
inserting values into expressions for reckoning. The implied scope of the substitution name is the containing elicitation form's assignment.
(6)
Type[nam, ptrnSet]
If ptrnSet evaluates True, and the rest of the containing elicitation matches, nam
is substituted throughout the implied scope. If nam is
reassigned in ptrnSet, that reassigned value is used
throughout the substitution name’s
scope. Within ptrnSet, nam is replaced by
a test value, and ptrnSet is evaluated. In (6), ptrnSet
is anything that evaluates True or False when it operates on nam.
Specifically,
ptrnSet[nam]
...must evaluate True or False. Any other result will generate an
error.
The following is an elicitation form argument,
and testSequence is a sequence of expressions.
(7) Type[subNam, testSequence]
If the last expression evaluated in testSequence returns True, together with any other Type[_, _] constructions in the elicitation containing (7), then subNam is substituted wherever it is found in the elicitated assignment. If subNam is reassigned within testSequence, that new value will be substituted throughout the elicited assignment.
Type[subNam, test] constructs define SubstitutionNames in elicitations.
A Name, followed by a sequence of 2-argument Type constructions, defines all or part of a Name’s elicitation.
(8) Name[nam[Type[v1, _PatternSet], Type[v2, _PatternSet],..], eval]
Equivalently,
Name[nam[v1_, v2_,..], eval]
...use the substitution names v1 and v2 to substitute values into eval wherever the v1 and v2 are found. In these many-argument Type constructs, the latter argument(s) are always evaluated using the literal value of the first argument unless that first argument is explicitly reckoned and reassigned in the latter argument(s).
For example,
Name[nam[Type[v,
Name[v, Reckon[v]], True], eval]]
...will substitute whatever v is assigned to, after it has been reckoned.
See PatternSequence and PatternTypeSequence first, if these are
unfamiliar.
(9) Type[nam, Pattern[Sequence]]
...also written as
nam__
...declares the SubstituteName, nam,
matching any Sequence of expressions.
(10) Type[nam, Pattern[Type[head]][Sequence]]
...also written as...
...matches any Sequence of expressions with Head matching head.
Often the easiest way to organize a Name's ElicitationForm is by patterned
Branch alternatives.
This strategy is a natural device where a general purpose algorithm
acquires input from diverse forms. The goal is
to filter possible input forms into a standard form
which can be processed by Name's assignment. The TypeBranch construct, (below), is for
this purpose.
Name[sym[Type[arg,
Branch[
pat1, do1,
pat2, do2,
...
patN, doN,
...
]]
],
(* assignmentBody goes here. *)
]
The result of the above assignment to the Name, "sym", is the
following:
When sym is elicited, its argument
sequence is given the substitution name, arg,
which is compared (in sequence) to each odd argument in the "Branch[pat1, do1,
pat2, do2, ...]"-construct until a match
occurs. If a match does
not occur, sym's ElicitationForm is not invoked.
If a match does occur, the argument
immediately after the matching PatternSet, (patN),
is conditionally scheduled for evaluation. If patN
is the matching PatternSet, and doN is the
subsequent Branch argument, then patN
may contain substitution names (Type[_,_]-constructs) used in the
subsequent doN-expression.
Successful "sym[patN ]"
elicitation is only conditionally scheduled to execute doN,
if sym has the NamePattern Attribute, or if the elicitation was in an assignment test ("True[sym[patN
]]"-construct). ("True[expr]" does not
execute expr's assignment (if it has one).) But
if "sym[patN ]" is allowed to return its
assigned result, then the above code returns doN
(because patN matched sym's argument, arg)
which is called the elicitation branch product.
Thus, the TypeBranch allows a concise way to branch according to a Name's argument Pattern. But, in addition, the TypeBranch can use the elicitation branch product as the argument to an assignmentBody. This possibility is represented in the above source code, except with the block comments, "(*" and "*)", removed. Then when "sym[patN ]" is elicited, and the assignment is allowed to execute, "assignmentBody" is evaluated using arg as a substitution name assigned to the elicitation branch product. The TypeBranch can bring diverse argument-forms into conformance with the algorithmic needs of the "assignmentBody".
1. The mark or impression of something; a distinctive stamp; sign; emblem.
The faith they have in tennis, and tall stockings,
Short blistered breeches, and those types of travel. Shak.
2. A figure or representation of something to come; a token; sign; symbol; -- correlative to antitype.
A type is no longer a type when the thing typified comes to be actually exhibited. South.
3. The general character, form, or structure common to a number of individuals and distinguishing them as a class, group, or kind. See def. 8, below.
4. A particular kind, class, or order; as, the seedless type of orange; criminals of the most dangerous type; also, Colloq., kind; sort; as, he won t stand for that type of thing.
5. That which or one who possesses or exemplifies characteristic qualities; a model; standard; exemplar; as, a novelist whose characters are types; he is the type of chivalry; also, sometimes, an archetype, or original pattern.
6. Anthrop. The pattern or average of characteristics which define an inbreeding division of man (as a tribe or nation), or of the fundamental characteristics which define a race, or of the characteristics of a homogenous group as determined by measurements on the skeleton or the body, the average range of variability considered as defining the type for the group.
7. Agric. Of livestock, the combination of characteristics appropriate to a special kind of use; as, beef type; hence, an animal or group having such a combination of characteristics.
8. Biol. a A form of being having the morphological and physiological characteristics by which a number of individuals may be classified together.
b An individual, species, genus, etc., considered as typical of a higher group. The type may or may not be the ideal representative of its group.
c Bot. & Zool. In some classifications, a group or division of animals or plants having the same general plan of structure; -- more or less equiv. to class or phylum.
d Short for TYPE GENUS, TYPE SPECIS, TYPE SPECIMEN.
9. Bio. & Physiol. A group classified according to the physiological and morphological characters of the individuals and to their specific interactions; as, a blood type. See BLOOD GROUP.
10. Chem. A simple compound, used as a model or pattern to which other compounds are conveniently regarded as being related, and form which they may be actually or theoretically derived. See TYPE THEORY.
11. Com. A sample of the quality, crop, etc., dealt in when grain, coffee, sugar, or other produce, is sold.
12. Cryst. A form of structure common to a group of crystals; also, the group having this form. See SYMMETRY.
13. [cap.] Eccl. Hist. An edict issued by the Emperor Constans II, A.D. 648, repealing the Ecthesis and forbidding all discussions of Monotheletism and Dyotheletism.
14. Math. The simplest of the forms equivalent with respect to a group of tranformations.
15. Numus. The figure or object on either side of coin or medal.
16. Philately. Any one of two or more stamps having identical designs but with minor variations.
17. Print. a A rectangular block,...
[From Websters1949Unabridged.]
(c) 2004-2007 by
John Van Wie Bergamini.
All rights reserved.