(0) Branch
…is a frequently used suffix or prefix keyword modifier.
Branch[test1, expr1, test2, expr2, …] a.k.a. BranchPairs
Branch[obj, …[sub_PatternSet→_Expression]…] a.k.a. BranchRules
Expression[Branch][expr] a.k.a. ExpressionBranch
See English definition of “branch”.
Branch[…] is used for two distinct types of branching structures.
Which branch type is elicited depends on whether there are an even or odd number of arguments.
See also Expression[Branch].
(1) Branch[test1, expr1,
test2, expr2,
…]
…returns expr1 if test1 evaluates True.
Otherwise expr2 is returned if test2 evaluates True.
Otherwise the next test is evaluated, and so on.
This Branch ElicitationForm always has an even number of arguments.
(2) Branch[obj,
patrn1, expr1,
patrn2, expr2,
…]
…compares obj to the PatternSet, patrn1, and if there is a match, expr1 is returned.
Otherwise, patrn2 is compared to obj, and expr2 is returned if there is a match.
Otherwise the next argument is tested and so on.
This Branch ElicitationForm always has an odd number of arguments.
Each even argument is a PatternSet.
If an even argument is selected (by matching), and it is a…
Type[nam, _PatternSet]
…construct, then nam is substituted into the subsequent expr.
This odd numbered argument Branch[…] construction, (2), has the equivalent ElicitationForm:
(3)
Branch[obj,
patrn1 → expr1,
patrn2 → expr2,
…]
…which is a form matching…
Branch[obj, …[_PatternSet→_Expression]…].
The Rule is similar and related to this form of Branch.
If expr is an Expression, (or a String which can be interpreted as an Expression), then…
(4) Expression[Branch][expr]
…returns a Sequence of irreducible Types like the following:
(5) …ExpressionAtom[slotSpecs]…
The Sequence in (5) fully specifies “expr”s structure and is called the ExpressionBranch structure (of expr).
“expr” is parsed into its Branch structure without anything being elicited.
(Invoking (4) is guaranteed to have no effect on the environment.)
The slotSpecs specify the ExpressionAtom’s position in the containing Expression.
The ExpressionAtom Sequence in (5) is listed in the order they will be processed when Reckoned.
A leaf is a subExpression such that True[leaf ] tests True.
In other words, a leaf is a simple, unassigned Expression.
(5) is the Sequence of leafs that fully specifies expr.
All leafs are ExpressionAtoms because they are irreducible Types.
ExpressionAtoms are so named because they are irreducible Expressions or basic Types.
An ExpressionAtom has a Head and may also include binary data (as its bracketed argument).
If an ExpressionAtom Head is (String | Cardinal | Real | Name | Compile), or a user-defined Type, then it will have (signature) binary data in the adjoined bracketed argument.
Other Grok32` Keywords may be ExpressionAtoms, but they have no arguments except the SlotSpecification (which is attached to all elements of the ExpressionAtom Sequence returned by (4)).
branch n.
1. A stem, larger than a shoot, growing on a tree or similar plant from the trunk or from a bough; a limb; more generally, from the trunk or from a bough; a limb; more generally, Bot., a shoot or secondary stem growing from the main stem.
2. Any division extending like a branch; any arm or part connected with the main body of a thing; a ramification; as, a branch of an antler, a chandelier, or a railroad.
3. Specif.:
a Either side of a sword hilt, forming one of the guards.
b Either side of a horseshoe.
c A pipe joined to and diverging from the barrel of another pipe.
4. A member or part of any complex body of work; a distinct article, section, subdivision, or department; as, a branch of the military service; branches of knowledge.
It is a branch and parcel of mine
oath. Shak.
5. Specif.: a A subordinate local office or part of a central system or business, usually occupying independent quarters; as, a branch of a library or post office. Cf. BRANCH
6. Arch. A rib in Gothic vaulting, generally one of the smaller ribs in a complicated vault.
7. Ethnol. A classificatory division, used esp. in the subdivision of linguistic families and stocks. It is more inclusive than the group and less so than the stock.
8. Fort. Either wing of a crownwork or hornwork; a boyau; also, any straight part joined to another at an angle.
9. Geneal. A division of a family descended from a particular ancestor, as distinguished from division descended from the ancestor’s relatives; as, the English branch of a family; also, Now Rare, any descendant.
10. Geog. A ramification, as of a river or another stream; specif.:
a An effluent stream; as, a delta branch.
b A reentrant stream; a by-channel.
c
d A bay-like fork of a tidal river, as of
the
See BROOK, CREEK, RUN.
11. Geom. a One of the portions of a curve, as of a hyperbola, that extends outward indefinitely. b One of the determinations of a non-uniform function of a complex variable; as, w = Sqrt[z] has two branches, one of which is always the negative of the other. Cf. PARABOLIC BRANCH, HYPERBOLIC BRANCH.
12. Naut. A warrant or commission given to a pilot, authorizing him to pilot vessels in certain waters.
13. Plumbing. A forked piece of pipe; -- called a double branch when there are two offshoots from the main pipe.
14. Zool. A primary division of the animal kingdom. See PHYLUM.
Syn. – Limb, shoot, offshoot, twig, sprig
branch v. Intrans.
1. To shoot or spread in branches; separate into branches; put forth branches; ramify.
Friths that branch and spread
Their sleeping silver thro’ the hills. Tennyson.
Corals branching ‘neath the ripple. Browning.
2. To spring off or out from the main branch, stem, or root, as a shoot of a plant; to diverge; to deviate; --usually with out or off; as, here a bypath branches.
To branch out into a long disputation. Spectator.
3. To be descended or derived; -- with from. Obs.
4. Bridge. In bidding, to change from one suit to another;
to switch.
Transitive:
1. To embroider with figures of branches, flowers, or foliage.
Branched with gold and pearl, most richly wrought. Spenser.
2. To put forth or arrange in or as in branches. Archaic.
3. To furnish with branches or horns. Obs.
4. To divide into or as into branches.
switch n.
4. An act of switching; the action or office of one who switches, as of one who tends a railroad switch; specif.:
a A blow of a switch.
b A turn of a switch.
c A changing or shifting, as of investments.
5. Elec. A device for making, breaking, or changing the connections in an electrical circuit…
[From Websters1949Unabridged.]
© 2004 by John Van Wie Bergamini. All rights reserved.