A Dictionary of J
Vector 7:2, page 99
Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 99
Doubtful transcription
The dictionary is set small in two columns with many side-by-side examples; their layout here is approximate, and the bold marking in the parsing table (Table 2) is read as nearly as the print allows. Check examples against the page.
The ISI Dictionary of J¶
J is a dialect of APL, a formal imperative language. Because it is imperative, a sentence in APL may also be called an instruction, and may be executed to produce a result. Because it is formal and unambiguous it can be executed mechanically by a computer, and is therefore called a programming language, a phrase from which its name derives. Because it shares the analytic properties of mathematical notation, it is also called an analytic language.
APL originated in an attempt to provide consistent notation for the teaching and analysis of topics related to the application of computers, and developed through its use in a variety of topics, and through its implementation in computer systems. Discussions of the language may be found in The Design of APL and The Evolution of APL [1]. Reference 2 discusses a freeware implementation of the language defined here, as well as its relation to the earlier version [3], which also provides information on other dialects.
A dictionary should not be read as an introduction to a language, but should rather be consulted in conjunction with other material (such as Reference 4) that uses the language in some context of interest. On the other hand, a dictionary should be used not only to find the meanings of individual words, but should also be studied to gain an overall view of the language.
I: Alphabet and Words¶
The alphabet used is that of ASCII, and the words used to denote facilities in the language are spelled with either one ASCII character or with one character followed by a full stop (.) or a stop (:). Spaces between such words are permitted but not required, except that a number beginning with a decimal point must be prefaced by a space or a zero. The entire spelling scheme is shown in the Language Summary of Table 1.
Pronouns and proverbs begin with a letter of the English alphabet and continue with further letters or digits. Such a name followed by a colon is a distinguished or non-standard word that may, in a particular implementation, be used to supplement the standard words.
Quotes behave much as in English: everything between an opening quote and a closing quote is treated as a single word, except that a pair of adjacent quotes following an opening quote represents the quote character itself; 'can''t' is the five-character abbreviation of the six-character word 'cannot'.
The negative sign is denoted by _, as in _3 and _3.14. The _ alone denotes infinity, and __ denotes negative infinity. A real number may also be denoted in exponential form, as in 3.25e4 to signify 32500. A complex number is denoted by a j between two real numbers, as in _3e4j5.6. Numbers separated by spaces denote a list or vector, as in prices=. 3.12 4.6 2e3.
II: Grammar¶
The following sentences illustrate the six parts of speech:
fahrenheit=. 50
(fahrenheit-32)*5%9
10
prices=. 3 1 4 2
orders=. 2 0 2 1
orders*prices
6 0 8 2
+/orders*prices
16
+/\1 2 3 4 5
1 3 6 10 15
bump=. +&1
bump prices
4 2 5 3
| PARTS OF | SPEECH |
|---|---|
50 fahrenheit |
Nouns/Pronouns |
+ - * % bump |
Verbs/Proverbs |
/ \ |
Adverbs |
& |
Conjunction |
( ) |
Punctuation |
=. |
Copula |
Verbs act upon nouns to produce noun results; the nouns to which a particular verb apply are called its arguments. A verb may have two distinct (but usually related) meanings according to whether it is applied to one argument (to its right), or to two arguments (left and right). For example, 2%5 yields .4, and %5 yields .2.
An adverb acts upon a single noun or verb (to its left) to produce a verb. For example, +/ is a (derived) verb called plus over that sums an argument list to which it is applied, and */ yields the product of a list. A conjunction applies to two arguments (either nouns or verbs) to produce a verb.
Punctuation is provided by paired parentheses that specify the sequence of execution as in elementary algebra. The word =. behaves like the copulas "is" and "are" and is read as such, as in "area is 3 times 4" for area=. 3*4. The name area thus assigned is a pronoun and, as in English, it plays the role of a noun. Similar remarks apply to names assigned to verbs, adverbs, and conjunctions.
A. Nouns¶
Nouns are classified in three ways: numeric or literal; open or boxed; arrays of various ranks, called (for ranks 0, 1, and 2) atom, list, and table, or (in mathematics) scalar, vector and matrix. Numbers and literals are represented as stated in Part I.
Arrays. A single entity such as 'A' or '+' or 2.3 or _2.3j5 is called an atom. The verb denoted by a comma chains its arguments to form a list whose shape (given by the verb $) is equal to the number of atoms combined. For example:
The verb |. used above is called reverse. The phrase s $ b produces an array of shape s from the list b. For example:
(3,4) $ date,1,8,6,7,1,9,1,7
1 7 7 6
1 8 6 7
1 9 1 7
table=. 2 3 $ word,'bat'
$ table
2 3
table
saw
bat
The number of atoms in the shape of a noun is called its rank. Each position of the shape is called an axis of the array, and axes are referred to by indices 0, 1, 2, etc. For example, axis 0 of table has length 2 and axis 1 has length 3. The last k axes of an array b determine rank-k cells or k-cells of b. For example, if:
then the list 'abcd' is a 1-cell of b, the two 3 by 4 tables are each 2-cells of b, and the letters are each 0-cells of b.
The rest of the shape vector is called the frame of b relative to the cells of rank k. For example, if $ c is 2 3 4 5, then c has the frame 2 3 relative to the cells of rank 2, the frame 2 3 4 relative to 5-element rank-1 cells, the frame 2 3 4 5 relative to rank-0 cells (atoms), and an empty frame relative to 4-cells.
A cell of rank one less than the rank of b is called an item of b, and items play an important role in the discussion of nouns and the application of verbs to them. For example, the verb from (denoted by {) selects items from its right argument, as in:
Moreover, the verb grade (denoted by /:) provides indices to { that bring items to "lexical" or "row-major" order. For example:
Negative numbers, as in _2-cell and _1-cell (an item), are also used to refer to cells whose corresponding frames are of the length indicated by the magnitude of the number. For example, the list abcd may be referred to either as a _2-cell or as a 1-cell of b.
Open and Boxed. The nouns discussed thus far are called open, to distinguish them from boxed nouns produced by the verb box denoted by <. The result of box is an atom, and boxed nouns are displayed in boxes. Box allows one to treat any array (such as the list of letters that represent a word) as a single entity, or atom. For example:
w=. words=. (<'I'),(<'was')
letters=. 'I was'
$ letters
5
|. letters
saw I
$ words
2
|. words
┌───┬─┐
│was│I│
└───┴─┘
2 3$w,|.w
┌─┬───┬───┐
│I│was│was│
├─┼───┼───┤
│I│I │was│
└─┴───┴───┘
B. Verbs¶
Monads and Dyads. Most verbs have two definitions, one for the monadic case (one argument), and one for the dyadic case (two arguments). In any sentence, the dyadic definition of a verb applies if it is preceded by a suitable left argument, that is, any noun that is not itself an argument of a conjunction; otherwise the monadic definition applies. The monadic case of a verb is also called a monad, and we speak of the monad % used in the phrase %4, and of the dyad % used in 3%4.
Ranks of verbs. The notion of verb rank is closely related to that of noun rank: a verb of rank k applies to each of the k-cells of its argument. For example (using the array b from Section A):
Since the verb ravel (denoted by ,) applies to its entire argument, its rank is said to be infinite or unbounded. The rank conjunction " used in the phrase ,"2 produces a related verb of rank 2 that ravels each of the 2-cells of b to produce a result of shape 2 by 12.
The shape of a result is the frame (relative to the cells to which the verb applies) catenated with the shape produced by applying the verb to the individual cells. Commonly these individual shapes agree, but if not, they are first brought to a common rank by adding leading unit axes to any of lower rank and are then brought to a common shape by applying the expression ms {. r to each result r, where ms is the maximum over the individual shapes. For example:
The dyadic case of a verb has two ranks, governing the cell ranks of the left and right arguments. For example:
Finally, each verb has three intrinsic ranks: monadic, left, and right. The definition of any verb need therefore specify only its behaviour on cells of the specified ranks, and the extension to arguments of higher rank occurs systematically. The ranks of a verb merely place upper limits on the ranks of the cells to which it applies, and its domain may include arguments of lower rank. For example, matrix inverse (%.) has monadic rank 2, but applies to degenerate cases of vector and scalar arguments by treating them as one-column matrices.
Agreement. In the phrase p v q, the arguments of v must agree in the sense that their frames (relative to the ranks of v) must either match, or the shorter (in terms of the number of axes) must match the suffix of the longer. Formally, if the frames of p and q are a,b and b, respectively, then p v q is equivalent to p v >a$<q. For example:
C. Adverbs and Conjunctions¶
Unlike verbs, adverbs and conjunctions have fixed valence; an adverb is monadic (applying to a single argument to its left), and a conjunction is dyadic.
Each argument of a conjunction may be either a noun or a verb, and it may therefore produce as may as four distinct classes of results. For example, u&v produces the composition of the verbs u and v; ^&2 produces the square by combining the power function with the right argument 2; and 2&^ produces the function 2-to-the-power. The conjunction & may therefore be referred to by different names for the different cases, or it may be referred to by the single term and (or with), which roughly covers all cases.
D. Comparatives¶
The comparison x=y is treated like the everyday use of equality (that is, with a reasonable relative tolerance), yielding 1 if the difference x-y falls relatively close to zero. Tolerant comparison also applies to other relations and to floor and ceiling (<. and >.); a precise definition is given in Part III under the comparative less-than-or-equal (<:). An arbitrary tolerance t can be specified by using the custom conjunction (&:), as in x =&:t y.
E. Parsing and Execution¶
A sentence is evaluated by executing phrases in a sequence determined by the parsing rules of the language. For example, in the sentence 10%3+2, the phrase 3+2 is evaluated first to obtain a result that is then used to divide 10. In summary, the parsing rules are:
- Execution proceeds from right to left, except that when a right parenthesis is encountered, the segment enclosed by it and its matching left parenthesis is executed, and its result replaces the entire segment and its enclosing parentheses.
- Adverbs and conjunctions are executed before verbs; the phrase
,"2-ais equivalent to(,"2)-a, not to,"(2-a). Moreover, the left argument of an adverb or conjunction is the entire verb phrase that precedes it. For example, in the phrasea+/..*/b, the rightmost adverb/applies to the verb derived from the phrase+/..*, not to the verb*. - Verbs are applied dyadically if possible. For example,
a-bsignifies subtraction, buta*-bsignifies multiplication ofaby the negative ofb. - Certain phrases that would be invalid under these rules are treated as idioms, as described in Section F.
One important consequence of these rules is that in an unparenthesized expression the right argument of any verb is the result of the entire phrase to the right of it. The sentence 3*p%q^|r-5 can therefore be read from left to right: the overall result is 3 times the result of the remaining phrase, which is the quotient of p and the part following the %, and so on.
Parsing proceeds by moving successive elements (or their values in the case of pronouns and other names) from the tail end of a queue (initially the original sentence prefixed by a left marker [) to the front of a stack, and eventually executing some eligible portion of the stack and replacing it by the result of the execution.
For example, if a=. 1 2 3, and if ◊ separates the queue and stack, then b=.+/2*a would be parsed and executed as follows:
[ b =. + / 2 * a ◊
[ b =. + / 2 * ◊ 1 2 3
[ b =. + / 2 ◊ * 1 2 3
[ b =. + / ◊ 2 * 1 2 3
[ b =. + ◊ / 2 * 1 2 3
[ b =. + ◊ / 2 4 6
[ b =. ◊ + / 2 4 6
[ b ◊ =. + / 2 4 6
[ b ◊ =. 12
[ ◊ b =. 12
[ ◊ 12
◊ [ 12
The foregoing illustrates two major points: 1) Execution of the phrase 2*1 2 3 is deferred until the next element (the /) is transferred; had it been a conjunction, the 2 would have been its argument, and the monad * would have applied to 1 2 3; and 2) Whereas the value of the name a is moved to the stack, the name b (because it precedes a copula) moves unchanged. Finally, a side effect is that the pronoun b is assigned the value 12.
The executions in the stack are confined to the first four elements only, and eligibility for execution is determined only by the class of each of these elements (noun, verb, etc.). The parsing rules are prescribed more formally in Table 2.
The classes of the first four elements of the stack are compared with the first four columns of the parse table, and the first row that agrees in all four columns is selected. The bold elements in the row are then subjected to the action prescribed in column 5, and are replaced by its single result.
F. Idioms¶
Any phrase, such as (+*-), which cannot be evaluated according to the normal grammatical rules, can, without contradiction, be assigned any idiomatic significance desired. The idioms fork and hook are defined by the following diagrams, using f, g, and h to denote functions (i.e., verbs):
For example, 5(+*-)3 is (5+3)*(5-3).
The sixth line of Table 2 shows the conditions for a fork: three verbs in the stack preceded by anything but a conjunction (which would, of course, seize the leading verb as its argument).
III. Definitions¶
Each main entry begins with a one-line header such as:
The header begins with the word being defined, accompanied (in the case of adverbs and conjunctions) by letters that specify the case under consideration: n and v for noun and verb right arguments; m and u for left arguments.
The ranks of the verb or derived verb are shown with the monadic rank followed by the left and right ranks. An infinite rank is denoted by _, and ranks dependent on the ranks of argument verbs and nouns are shown as mv, lv, rn (for rank of n), etc.
The header concludes with suggested names for the entry. Except for minor re-ordering due to the grouping of related verbs (such as + * - %), the entries are presented in the order of the language summary of Table 1, an order also shown at the foot of each page. Arguments in the definitions are denoted by x and y.
=Ranks:_ 0 0Classify ; Equal-
MONAD.
=yclassifies the items of the nub of y according to equality with the items of y, producing a boolean table of shape#~.yby#y. For example:DYAD.
x=yyields1if x is (tolerantly) equal to y. See<:. =.=:Is(Local)/Is(Global)- Copulas, for use as in
vol=. 5*area=. 3*4andSUM=. +/. The=.is local, and=:is global, as discussed under::. Copulas may also be used indirectly. For example, ifx=.'abc';'de'and(x)=.3 4;5 6 7then the values3 4and5 6 7are assigned toabcandde. Similarly,'ab'=. i.2assigns0toaand1toband(2 3 $ 'abcdef') =. i.2 3assigns4toeetc. <Ranks:_ 0 0Box ; LessThan-
MONAD.
<yis an atomic encoding of y in the sense that it has rank 0 and can be decoded (by>). See boxed nouns in Section II.A.DYAD.
x<yis1if x is (tolerantly) less than y. See<:. >Ranks:0 0 0Open ; LargerThan-
MONAD. Open (
>) is the inverse of box (<), that is,y -: ><y. When applied to an open array (that has no boxed elements), open has no effect. Opened atoms are brought to a common shape as discussed in Section II.B.DYAD.
x>yis1if x is (tolerantly) larger than y. See<:. <.>.Ranks:0 0 0Floor/Ceiling ; Min (LesserOf)/Max-
MONAD.
<.ygives the floor or integer part of y; thus,<. 3.1 _3.1is3 _4. The implied comparison with integers is tolerant (see<:), and<.yis therefore the largest integer such that(<.y)<:y. The ceiling>.yis defined by-<.-y. See<:for tolerance, and McDonnell [5] for the case of complex arguments.DYAD.
x<.yyields the lesser of x and y, andx>.yyields the larger. For example,3 <. 4 _4is3 _4. <:>:Ranks:0 0 0Inc(rement)/Dec ; LsOrEqual/LgOrEqual-
MONAD.
<:yisy-1, and>:yisy+1. Also see-..DYAD. The result of
x<:yis1if x is less than or equal to y, and is otherwise0. However, the comparison is made with a certain tolerancetnormally set to 2 to the power_44but also controlled by the custom conjunction&:, as inx&:0.125 y. Formally,x<:yis1if|x-ydoes not exceedttimes the larger of the magnitudes of x and y. Tolerance applies similarly to other relations, in particular to greater than or equal to (>:), to match and floor (-:and<.), but not to grade (/:). _- The
_is not a verb, but denotes a negative number (as in_3.4), infinity (when used alone), or negative infinity (in__). + * - %Ranks:0 0 0; Plus/Times/Minus/Divide-
MONAD. The following definitions and examples apply:
Conjugate +yis(\|y*y)%y+3j5is3j_5Signum *yisy% \|y*_3 0 5is_1 0 1Minus -yis0-y-7is_7Reciprocal %yis1%y%4is.25DYAD. These are defined as in elementary arithmetic except that
0%0is0. See McDonnell [6]. +.*.+:*:Ranks:* 0 0; Gcd(Or)/Lcm(And)/Nor/Nand- DYAD.
x*.yis the least common multiple of x and y, andx+.yis the greatest common divisor. For boolean (0and1) arguments,+.is equivalent to or, and*.to and. Thus0 0 1 1 +. 0 1 0 1is0 1 1 1, and0 0 1 1 *. 0 1 0 1is0 0 0 1. Finally,x+:yis-.x+.y, andx*:yis-.x*.y. -.Ranks:0 _ _Not(1-) ; Less-
MONAD.
-.yis equivalent to1-yand, in the case of a boolean argument, to logical negation.DYAD.
x-.yare all the items of x except for those that occur as cells of y. -:Ranks:* _ _; Match- DYAD.
-:yields1if its arguments match completely, in shapes, boxing, and elements; but using tolerant comparisons. See<:. %.Ranks:2 _ 2MatrixInv ; MatrixDiv-
MONAD. If y is a non-singular matrix, then
%.yis the inverse of y, that is,(%.y)+/..*yis the identity matrixid=. =i.#y.More generally,
%.yis defined in terms of the dyadic case asid %.y, or, equivalently, by the relation(x%.y)-:(%.y)+/..*x. The shape of%.yis|.$y. The degenerate vector and scalar cases are defined by using;y, but the shape of the result is$y. For a non-zero vector y, the result of%.yis a vector collinear with y whose length is the reciprocal of the length of y.DYAD. If the columns of y are linearly independent, and if
#xand#yagree, thenx%.yis defined to minimize the elements ofr=. +/d*+d=. x-y+/..*x%.y. If y is square, it is necessarily non-singular (since its columns are independent), the elements of r are all zero, andy+/..*x%.ymatches x. As in the monadic case, degenerate cases of y are treated as;y.Geometrically,
y+/..*x%.yis, the projection of the vector x on the column space of y, the point in the space spanned by the columns that is nearest to x. Common uses of%.are in the solution of linear equations, and in the approximation of functions by polynomials (as inc=. (f x)%.x^/i.4). %:Ranks:0 0 0Square Root; Root- The x-root of y (denoted by
x%:y) is equivalent toy^%x. Thus,3%:yis the cube root of y. The square root (denoted by%:y) is equivalent to2%:y. ^^.Ranks:0 0 0Exponential/Natural Log ; Power/Log-
MONAD. The exponential (
^y) is equivalent toe^y, whereeis Euler’s number^1(approximately2.71828). The natural logarithm (^.) is inverse to^, that is,y=^.^y, andy=^^.y.DYAD.
y^2andy^3andy^0.5are the square, cube, and square root of y. The general definition ofx^yis^y*^.x, and applies for complex numbers as well as real. For a non-negative integer right argument it is equivalent to*/y#x; in particular,*/applied to an empty list is1, andx^0is1for any x, including the case wherex=0.The base-x logarithm
x^.yis the inverse of power in the sense thaty=x^.x^yandy=x^x^.y. u^:nRanks: mu lu ru Power ; Chain-
MONAD. The verb u is applied n times. For example,
-/^:2 yis-/-/y. A negative value of n denotes|napplications of the obverse (normally the inverse) of u. Infinite n produces the limit of the application of u. Thus ify=. 1, then2&o. ^:_ yis.73908, the solution to the equation y = Cos y.DYAD.
x u^:n yis defined as:where
x u^:0 yandx u^:1 yare defined as y andx u y. Thus,0+^:(i.8)1yields fibonacci numbers. See Tu and Perlis [7]. u^:vRanks: mu lu ru Power ; Chainu^:v yis equivalent tou^:(v y) y, andx u^:v ytox u^:(x v y) y.$Ranks:_ 1 _ShapeOf ; Shape-
MONAD.
$yyields the shape of y, as defined in Section II.A.DYAD. The shape of
x$yisx,siy, wheresiyis the shape of an item of y. For example:These show that the result is formed from the items of y, the last 1-cell (
abcd) showing that the selection of items is cyclic. $.$:Suite/SelfReference- See
::(General Definition). u~Ranks: lv>.rv rv lv Both ; Cross- The adverb
~commutes or crosses the connections to the argument(s). Thus,(x u~y)-:(y u x)and(u~y)-:(y u y). ~.Ranks:_ * *Nub ;-
MONAD.
~.yselects the nub of y, that is, all of its distinct items:More precisely, the nub is obtained by selecting the leading item, suppressing from the argument all items (tolerantly) equal to it, selecting the leading remaining item, and so on.
~:Ranks:_ 0 0NubSieve ; NotEqual-
MONAD. The result of
~:yis a boolean list b such thatb#yyields the nub of y, that is,~.y.DYAD.
x~:yis1if x is (tolerantly) unequal to y. See<:. |Ranks:0 0 0Magnitude ; Residue-
MONAD. The magnitude of y is
%:y*+y. For example,|_6 3j4is6 5.DYAD. The familiar use of residue is in determining the remainder in dividing a non-negative integer by a positive integer. Thus:
The definition :
extends this notion to a zero left argument (which yields the right unchanged), and to negative and fractional left arguments. For a negative left argument, the result ranges between the left argument and zero, as it does for a positive left argument. For example:
However, to produce a true zero for cases such as
(%3)|(2%3), the residue is made tolerant by the following definition:x|yisy-x*<.sif(x~:0)*.(>.s)~:<.s=.y%x+x=0and is otherwisey*x=0.For example,
.1 | 2.5 3.64 2 _1.6is0 0.04 0 0. The definition also applies to complex numbers, using the properties of the floor on complex arguments. |.Ranks:_ 0 _Reverse ; Rotate-
|.yreverses the order of the items of y, andk|.yrotates them: |:Ranks:_ 1 _Transpose-
MONAD. This verb reverses the order of the axes of its argument, and is equivalent to
(i.-$$y)|:y.DYAD.
x|:ymoves axes x of y to the tail end. If x is boxed, the axes in each box are "run together" to produce a single axis in the result. For example: u..vRanks:2 _ _Determinant; DotProduct-
MONAD. The expressions
-/..*and+/..*are the determinant and permanent of square matrix arguments. More generally,u..vis defined in terms of a recursive expansion by minors:where b is
DYAD. For vectors and matrices,
x+/..*yis equivalent to the dot, inner, or matrix product of mathematics, and other rank-0 functions such as<.+.and*.are treated analogously. Thus,x u..v yis defined byu x v"(lv,_1)"((1+lv),_)y.In other words, u is applied to each of the items produced by applying v to each item of the list of "left-argument cells" and the items of y. The shapes of x and y must be such that the number of items in these left and right arguments agree. For example, if the ranks of v are 2 and 3, the shape of the result of u is sr, and the shapes of x and y are
2 3 4 5 6and4 7 8 9 10 11, then the shape of the result is2 3 7 8,sr. u:.vObverse- The result of
u:.vis the verb u but with an assigned obverse v (used as the "inverse" under the conjunctions"and^:). m::nRanks:_ _ _General Definition-
If m is non-numeric, the conjunction
::produces a verb whose monadic and dyadic cases are determined by m and n, respectively. Iff=. '2$:y.' :: 'y.^%x.'thenf 64is the square root and3 f 64is the cube root of 64. As illustrated by the foregoing,x.andy.denote the arguments and$:denotes the function being defined, thus providing the "self-reference" that is also useful in recursive definition. Also seex0:andy0:.In general, m and n are boxed lists, the sentences in the boxes being executed in a sequence determined by the suite
$.. An open list (as illustrated above) is treated as a single box, and the items of an open table are treated as a list of boxes. The following example shows the definition of an adverb g:The suite
$.determines the sequence in which the sentences are executed. It is initially set toi.ns, wherensis the number of sentences; in the present example, it is reset to execute sentence 1 the number of times specified by the right argument. The explicit result of the verb is the result of the sentence executed last.Any name assigned by the copula
=.is made strictly local on its first assignment; that is, values assigned to the name have no effect on the use of the name outside of the verb or within other verbs invoked by it. The namesx.y.$.$:are also local.If sentence k begins with a name followed by a right parenthesis, the name is made local and set to
k}.i. ns. Such a label is useful in setting the suite to effect branching.Adverbs. If m is 1, then
m::vyields an adverb. Ifr=. 1::'|.&x.&|.', then-/\r 1 2 3 4yields2 3 1 4.Conjunctions. If m is 2, then
m::nproduces a conjunction. For example, if:then
o.pow 2 (1)is the square of pi. m::vu::nu::vDefinition- The first argument specifies the monadic case, and the second argument the dyadic case, using in m and n the conventions defined under the case
m::nabove. ,Ranks:_ _ _Ravel ; Append-
MONAD.
,ygives a list of the atoms of y in "normal" order; the result is ordered by items, by items within items, etc. The resulting shape is1$*/$y. Thus,(,i. 2 3 4)-:i.*/2 3 4.DYAD.
x,yappends items of y to items of x after 1) Reshaping one atomic argument to the shape of the items of the other, 2) Bringing the items to a common rank (of at least 1) by repeatedly itemizing (,:) any of lower rank, and 3) Bringing them to a common shape by using overtake ({.). Compare with the "permissive frame-building" in Section II.B. For example, ify=.i.2 3: ,.Ranks:_ * *Raze;-
MONAD.
,.yassembles along a leading axis the opened elements of the ravel of y. For example: ,:Ranks:_ _ _Itemize ; Laminate-
MONAD.
,:yadds a single unit axis to y, making the shape1,$y.DYAD. An atomic argument in
x,:yis first reshaped to the shape of the other; the arguments are then itemized and appended, as in(,:x),(,:y). ;Ranks:_ _ _Table ; Link-
MONAD.
;yis a table formed by ravelling the items of y. In particular, the result has shape1 1if y is an atom.DYAD.
x;yis(<x),yif y is boxed, and(<x),<yif y is open. u;.nRanks:_ 1/2 _Cut-
Cases
;.0and;.3have left rank 2. Others have left rank 1.MONAD. The phrase
u;.1 yapplies u to each of a set of intervals of items of y to produce the items of the result. Each interval begins at an occurrence of the delimiter0{y. For example:<;.1 y=. ' worlds on worlds' ┌───────┬───┬───────┐ │ worlds│ on│ worlds│ └───────┴───┴───────┘ b=. 5 3$i.9 $;.1 y 7 3 7 b 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 (+/;.1)b 9 12 15 3 5 7The phrase
u;._1 ydiffers only in that the delimiters are excluded from the intervals. In the casesu;.2andu;._2the delimiter is the last item, and marks the ends of intervals.The phrase
u;.0 yapplies u to y after reversing y along each axis, and is equivalent to(0 _1*/$y)u;.0 y.The monads
u;.3andu;._3apply u to tesselation by "maximal cubes", that is, they are defined by their dyadic cases using the left argument($$y)$<./$y.DYAD. The dyads
u;.1andu;._1andu;.2andu;._2differ from the monads in that the intervals are delimited by the ones in the boolean argument x. For example, ifx=. 0 1 0 0 1andy=.i.5 3:The phrase
x u;.0 yapplies u to a "rectangle" or "parallelepiped" of y with one vertex at the point in y indexed byv=. 0{x, and with the opposite determined as follows: the dimension is|1{x, but the rectangle extends back from v along any axis k for which the indexk{0{xis negative. Finally, the order of the selected elements is reversed along each axis k for whichk{1{xis negative. For example,(1 _2,:_2 3)+;.0 i.4 5is11 12 13;6 7 8.The cases
u;.3andu;._3provide (possibly overlapping) tesselations. The phrasex u;._3 yapplies u to each complete rectangle of size|1{xobtained by beginning at all positions obtained as integer multiples of (each element of) the movement vector0{x. As inu;.0, reversal of each piece occurs along an axis for which the "window"1{xis negative.The degenerate case of a list x is equivalent to the left argument
1,:x, and therefore provides a complete tesselation of size x.The case
u;.3differs fromu ;._3only in that any shards of sizes less than|1{xare included. For example: ;:Ranks:1 * *Words- MONAD.
;: yis the list of boxed words in the list y according to the rhematic rules of Part I. #Ranks:_ 1 _Tally ; Copy-
MONAD.
#yis1if y is an atom, and is otherwise the number of items in y.DYAD. If the arguments have an equal number of items, then
x#ycopies+/xitems from y, withi{xrepetitions of itemi{y; if one is an atom, it is repeated to make the item count of the arguments equal; if both are atoms, they are treated as one-element lists. #.Ranks:1 1 1Base2 ; Base-x-
MONAD. The base-2 value of y, that is,
2#.y.DYAD. A weighted sum of the items of y; that is,
+/w*y, wherew=. *\}.x,1. For example,10 #. 1 2 3is123, and24 60 60 #. 1 2 3is3723. #:Ranks:_ 1 0Antibase2 ; Antibase-
MONAD.
#: yis the representation of y in base 2, equivalent to(m#2)#:y, where m is the maximum of the number of digits needed to represent the elements of y in base 2. For example:DYAD. For simple cases,
#:is inverse to#.and, in general,x#.x#:yis(*/x)|y. u@vRanks: mv lv rv Atop- The monad
u@v yis equivalent to with(u&v y). The dyadx u@v yis defined asu x v y. For example,3|@-7is4. @.Ranks:1 1 _Permute-
MONAD and DYAD. If p is a permutation of the atoms of
i.n, then p is said to be a permutation vector of order n, and ifn=#b, thenp{bis a permutation of the items of b.@.pyields a list of boxed lists of the atoms ofi.#pcalled the standard cycle representation of the permutation p. For example, ifp=. 4 5 2 1 0 3, then@.pis(,2);4 0;5 3 1because the permutation p moves to position 2 the item 2, to 4 the item 0, to 0 the item 4, to 5 the item 3, to 3 the item 1, and to 1 the item 5. The monad@.is self-inverse; applied to a standard cycle it gives the corresponding direct representation.A given permutation could be represented by cycles in a variety of ways; the standard form is made unique by the following restrictions: the cycles are disjoint and exhaustive (i.e., the atoms of the boxed elements together form a permutation vector); each boxed cycle is rotated to begin with its largest element; and the boxed cycles are put in ascending order on their leading elements.
Non-Standard Representations. If p and c are standard and cycle representations of order
#b, thenp@.bandc@.bproduce the corresponding permutations of items of b. More generally, since the tally of b determines the order of the permutation, the arguments p and c may be non-standard in ways to be defined. In particular, negative integers down to-#bmay be used, and are treated as their residues modulo#b.If q is not boxed, and if the elements of
(#b)|qare distinct, thenq@.bis equivalent top@.b, where p is the standard form of q given byp=. ((i.n)-.n|q),n|q, wheren=. #b. In other words, positions occurring in q are moved to the tail end.If q is boxed, the elements of
(#b)|>j{qmust be distinct for each j, and the boxes are applied in succession. Thus,(2 1;3 0 1)@.i.5is(<2 1)@.(<3 0 1)@.i.5, and the result of either is the standard direct permutation1 2 3 0 4.The transformation provided by the monad
@.is extended to non- negative non-standard cases by treating any argument q as a representation of a permutation of order1+>./,.q. @:Ranks:1 0 _Atom;AtomPermute-
MONAD and DYAD. If T is the table of all
!npermutations of order n arranged in lexical order (that is,/:Tisi.!n), then k is said to be the atom representation of the permutationk{T. Moreover,k@:bpermutes items of b by the permutation of order#bwhose atom representation is(#b)|k. For example,1@:btransposes the last two items of b and_1@:breverses all items, and3@:band4@:brotate the last three items of b. Finally,(i.!n) @:i.nproduces the ordered table of all permutations of order n, as does(i.&!@:i.)n.The monad
@:applied to any cycle or direct permutation yields its atom representation. For example,@: 0 3 2 1is5, as are@:3 2 1and@: 0;2;3 1and@: <3 1. u/Ranks:_ _ _Insert ; Function Table-
MONAD.
u/yapplies the dyad u between the items of y. Thus:If y has no items (that is,
0=#y), the result ofu/yis the identity element of the verb u. An identity element of a function u is a value e such that eitherx-:x u eorx-:e u xfor every x in the domain (or perhaps some significant sub-domain such as boolean) of u. This definition of insertion over an argument having zero items, extends partitioning identities such as(+/y) -: (+/k{.y)+(+/k}.y)to the casesk=.0andk=.#y.The identity function of a verb u is a function
ifusuch that(ifu y) -: (u/y)if0=#y. Denoting v inverse byiv, the identity functions are:$&0&}.&$ < > + - +.~:| $&1&}.&$ = <:>:* % *.%:^ ! $&_&}.&$ <. $&__&}.&$ >. i.&(0&,)&(2&}.)&$ , i.&(1&{.)&}.&$ @.{ =&i.&(1&{.)&}.&$ %.+/..* ifu&# u/ $&(iv ifu$0)&}.&$ u"vDYAD. If x and y are numeric lists, then
x */ yis their multiplication table. For example:In general, each cell of x is applied to the entire y, that is,
x u/yisx u"(lu,_)y. u/.Ranks:_ _ _Oblique ; Key-
MONAD. If
a=.i.3 4, then</.ais(,0);1 4;2 5 8;3 6 9;7 10;,11, that is, the(3+4)-1elements of the result are obtained by applying<to each of the oblique lines of y. Hence, if p and q are the coefficients of two polynomials,+//.p*/qyields the coefficients of the product polynomial.More generally,
u/.yis the result of applying u to the oblique lines of_2-cells of y. If the rank of y is less than two, y is treated as the table;y.DYAD.
x u/.yis(=x)u@#y, that is, items of x specify keys for the corresponding items of y, and u is applied to each of the collections of y having identical keys. For example,1 2 3 1 3 2 1 </.'abcdefg'yields'adg';'bf';'ce'. /:\:Ranks:_ 1 _GradeUp/GradeDown;Sort-
MONAD.
/:grades its argument, yielding a permutation vector such that(/:y){ysorts y in ascending order. For example:As illustrated above, elements of g that select equal elements of y occur in ascending order.
If y is a table,
/:ygrades the base value of the rows, using a base larger than the magnitude of any of the elements. A y of higher rank is treated as;y, that is, as if its items were each ravelled.If y is literal,
/:ygrades according to the collating sequence specified by the alphabeta.; any other collating sequencecscan be imposed by grading the result ofcs i. y.Downgrade is like upgrade, except that the items of
(\:y){yare in descending order.DYAD.
x /: yis defined by(/:y){x; that is, x is sorted into an order specified by y. In particular,y/:y(or/:~y) sorts y. u\u\.Ranks:_ 0 _Scans:Prefix/Suffix;Infix/Outfix-
MONAD.
u\yhas#yitems resulting from applying u to each of the prefixesk{.y, for k from 1 to#y. Thus,<\'abc'yields(,'a');'ab';'abc', and+/\1 2 3 4is1 3 6 10.u\.yhas#yitems resulting from applying u to suffixes of y, beginning with one of length#y(that is, y itself), and continuing through to a suffix of length 1.DYAD. If a is positive, then the items of
a u\yresult from applying u to each infix of length a. If a is negative, then u is applied to the non-overlapping infixes of length|a, including a possible final shard . Thus,2<\q=. 'abcde'is'ab';'bc';'cd';'de', and_2<\qis'ab';'cd';,'e'.If a is positive in the expression
a u\. y, then u applies to the outfixes of y obtained by suppressing successive infixes of length a. If a is negative, the outfixes are determined by suppressing non-overlapping infixes, the last of which may again be a shard. For example,2<\.qis'cde';'ade';'abe';'abc'. {Ranks:1 0 _Catalog;From-
MONAD.
{yforms a catalog from the atoms of its arguments, its shape being the chain of the shapes of the opened items of y, and the common shape of the boxed results is$ y. The case{a;<bis called the cartesian product of a and b. Thus:{'ht';'ao';'gtw' ┌───┬───┬───┐ │hag│hat│haw│ ├───┼───┼───┤ │hog│hot│how│ └───┴───┴───┘ ┌───┬───┬───┐ │tag│tat│taw│ ├───┼───┼───┤ │tog│tot│tow│ └───┴───┴───┘ >{10 11;i.2 2 10 0 10 1 10 2 10 3 11 0 11 1 11 2 11 3DYAD. If x is an integer in the range from
-#yto<:#y, thenx{yselects item(#y)|xfrom y. More generally, x may be a boxed list, whose successive elements are (possibly) boxed lists that specify selection along successive axes of y. For example:Finally, if any
r=.>j{>xused in the selection is itself boxed, selection is made by the indices along that axis (i.j{$y) that do not occur in>r. Thus,(<(<<2 0),(<<1 3)){yisgikl. m}u}Ranks:_ _ _Merge-
The function
m}is equivalent tom&{}.MONAD.
u}yis a merge of the items of y whose shape is the shape of an item of y. Each atom in the merge is selected as a corresponding atom in an item, the particular item being specified by the index in the corresponding position ofu i.}.$y(whose shape must be the shape of an item of y). For example, ifm=.0 1 3 1 2, andu=.m&{, then:DYAD. If x has the same shape as the index array
j=. u i.$y, thenx u}yproduces a merge of x and y by inserting the atoms of x in the selected positions of y. More generally, the shape of x may be a suffix of the shape of j, and the result is a merge of($j)$,xand y. For example, ifx=. 'AGMS'andu=.(<0 1)&|:(the diagonal function), then: {.Ranks:_ 1 _First;Take-
MONAD.
{. yselects the leading item of y; that is, y if y is an atom, and0{yif it is not.DYAD. If x is an atom,
x{.ytakes from y an interval of|xitems; beginning at the front ifx>:0, and ending at the tail ifx<0. For example:In an overtake (as in
4{.yand_4{.yabove), extra items consist of fills; zeros if y is numeric, boxed empties if it is boxed, and spaces otherwise. If y is an atom, the result of1{.yis a one-element list. Finally, if$yis0,s, then the fill items ares$0.In general, x may be a vector of length no more than
$$y; the effect of element k is(k{x){."(($$ y)-k)y. }.Ranks:_ 0 _Rest;Drop-
MONAD.
}. yselects the rest of the items of y after the first, and is equivalent to1}.y.DYAD.
x}.ydrops (at most) x items from y in a manner similar to{.. {:}:Ranks:_ _ _Right/Left- Both monads are nilpotent, yielding their arguments. The dyad
{:yields its right argument, and}:the left. m"nRanks:|.3$ |.nConstant- The ranks of the derived verb are specified directly by n if it has three elements, and otherwise by
|.3$ |.n. Thus a single element specifies all ranks, and the last of two elements specifies the monadic and right ranks. The derived verbm"nproduces the constant result m for each cell to which it applies. u"nRanks:|.3$|.nRank- The function
u"nis identical to u except that its ranks are determined by n as specified underm"n. u"vRanks: mv lv rv Rank- The function
u"vis equivalent to u except that its ranks are the ranks of v. ".Ranks:1 1 1Execute-
MONAD.
".yis the result of executing the character list y. Thus,".'a=.3+4'assigns the value 7 to the name a and yields the explicit result 7. The result of".''is the empty list.DYAD.
x".yis the result of".yif y is a valid sentence (whose execution finishes properly). Otherwise it is the result of".x, which may invoke an error report in the normal manner. ":Ranks:_ 1 1Format-
MONAD.
":yis equivalent tox":y, where x is chosen to provide a minimum of one space between columns. Default output is identical to this monadic case.DYAD.
x":yproduces characters from the alphabeta.that represent y in a format specified by x. Each element e of x controls the representation of the corresponding element of y as follows:w=.<.|especifies the total width allocated; if this space is inadequate, the entire space is filled with asterisks. If e is zero, enough space is allocated.d=.<.10*(|e)-wspecifies the number of digits following the decimal point (which is itself included only if d is not zero).Any negative sign is placed just before the leading digit.
If
e>:0, the result is right justified in the space w.If
e<0, the result is put in exponential form (with one digit before the decimal point) and is left-justified except for two fixed spaces allowed on the left (including one for a possible negative sign).Boxed elements are displayed in boxes, as shown in Section II.A.
The custom conjunction specifies the number of digits of precision for real numbers. For example,
":&:4 (5%3)yields1.667. m&vu&nRanks: (rm>.rv)/(lu>.rn)* *Withm&v yis defined bym v y, andu&n ybyy u n.u&vRanks: mv mv mv With-
MONAD.
u&v yis defined byu v y, applying individually to the cells of rank mv.DYAD.
x u&v yis defined by(v x) u (v y). u&.vRanks: mv mv mv Under-
The function
u&.vis equivalent to the compositionu&vexcept that the function obverse to v is applied to the result for each cell. The obverse pairs are specified by the conjunction:.or by:For example, the phrase
x+&.^.yyields the product of x and y, and|.&.>yreverses each of the boxed elements of y. &:Custom- Unlike other conjunctions, this one applies in a manner specific to each verb. For the relations, its right argument specifies the tolerance to be used, as in
<&:(2^_44). For other verbs (such as":), the effects are discussed in their definitions. !Ranks:0 0 0Factorial;Outof-
MONAD. For a non-negative integer y, the definition of
!yis*/>:i.y. In general,!yis gamma>:y.DYAD. For non-negative arguments
x!yis the number of ways that x things can be chosen out of y. In general it is defined as(!y)%(!x)*(!y-x), with the understanding that infinities (occasioned by!on a negative integer) cancel if they occur in both numerator and denominator. For example: !:External- This conjunction is used to communicate with the operating system as well as with the keyboard (as an input file) and with the screen (as an output file). See Appendix B.
?Ranks:0 0 0Roll;Deal-
MONAD.
?yyields a uniform random choice fromi.y.DYAD.
x?yyields a list of x items chosen at random without repetition from the listi.y. )Label-Command- This parenthesis sets off a label in function definition (See
::), and introduces a command to change certain parameters as detailed in Appendix A. a.Alphabeta.is a list of the elements of the alphabet; it determines the collating sequence used in sorting (/:and\:).e.Ranks:_ 0 _RazeIn;In-
MONAD.
e.yproduces a boolean result that determines for each atom of y whether its open contains each item of the raze of y. Thus:DYAD. If x has the shape of an item of y, then
xe.yis1if x matches an item of y. In general,xe.yis(#y)>y i.x. For example: E.Ranks:* _ _;In-
DYAD. If
b=.x E. y, then the ones in b indicate the beginning points of occurrences of the pattern x in y. For example: i.Ranks:1 _ _Integers;IndexOf-
MONAD. The shape of
i.yis|y, and its atoms are the first*/ynon-negative integers. For example:As shown in the examples, a negative element in y causes reversal of the atoms along the corresponding axis.
DYAD. If
rixis the rank of an item of x, then the shape of the result ofxi.yis(-rix)}.$y. Each atom of the result is either# x, or the index of the first occurrence among the items of x of the correspondingrix-cell of y. o.Ranks:0 0 0-
MONAD.
o. yyields pi times y. For example,o.1is3.14159.DYAD.
k o. yis one of the circular, hyperbolic, or pythagorean functions, according to the following table:k function k function 0 %:1-y^27 Tanh y 1 Sine y 8 %:_1-y^22 Cosine y 9 (y++y)%23 Tangent y 10 \|y4 %:1+y^211 (y-+y)%0j25 Sinh y 12 (^.*y)%0j16 Cosh y The function
(-k)o.yis inverse toko.y. In particular, the cases_1,_4,_9, and_10, are Arcsine y,%:_1+y^2, y, and+y. The arguments of Sine, Cosine, and Tangent (and the results of their inverses) are in radians. x.y.- These denote the arguments in a definition as defined for under General Definition (
::)
References¶
- Falkoff, A.D., and K.E. Iverson, The Design of APL, IBM Journal of R&D, July 1973 and The Evolution of APL, ACM Sigplan Notices, August 1978.
- Hui, et al., APL\?, APL90, ACM.
- Iverson, K.E., A Dictionary of APL, ACM APL Quote-Quad, September 1987.
- Iverson, K.E., J, Vector (British APL Assoc.), August 1990.
- McDonnell, E.E., Complex Floor, APL73, North Holland.
- McDonnell, E.E., Zero Divided by Zero, APL76, ACM.
- Tu, Hai-Chen, and A.J. Perlis, IEEE Software, January 1986.
Acknowledgments¶
I am indebted to Mr. Roger Hui for his rapid development of a flexible, reliable, and highly portable implementation of J, for his close collaboration in the design of the language, for critical reading of successive drafts of the dictionary, and for significant contributions to the treatments of certain topics, in particular, the identity functions.
Appendix A: System Commands¶
The following commands may be entered at any point in a session; the leading right parenthesis distinguishes them from normal sentences. Brackets indicate that the argument y is optional; when omitted, the present value of the parameter is printed.
A right parenthesis may also be used to specify a label, as described under the conjunction :: (definition).
)box [y]- The eleven-element integer list y specifies the indices of the ASCII characters to be used in displaying boxed arrays, in the order :
┌ ┬ ┐ ├ ┼ ┤ └ ┴ ┘ │ ─ )clear- Restore to initial condition, erasing all names.
)off- Terminate session.
)prompt [y]- The prompt for immediate input is specified by y. The default value is
' '(that is, three spaces). )reset- Terminate all suspended functions.
)rl [y]- The "random link" used as a "seed" by the random number generator (
?) is specified by y. The default value is16807. )script [y]- The argument is one (quoted) file name for input or two (as in
'abc' 'defg') for input and output. Except that system commands are ignored, the entire input file is executed as a script before further input is accepted from the keyboard. An unquoted dash (-) for the input file denotes keyboard input. The output is directed to the screen as well as to any designated output file. An output file so generated is suitable as the input in a subsequent command. )sscript [y]- Behaves like )script, except that output does not appear on the screen.
)si- Stack Indicator, showing functions currently suspended.
Appendix B: External Conjunction¶
0!:0 y- The list y is executed by the host system, and the result is returned.
1!:0 y- Directory.
1!:1 y- File read: y designates a file to be read, and the result is a string of the file contents; y may be a boxed name suited to the host file system, or it may be the number 1, designating the keyboard as the source file.
x 1!:2 y- File write: x is a string, and y is a boxed file name, or the number 2 designating screen output.
x 1!:3 y- File append (like
x 1!:2 y, but appends rather than replaces). 1!:4 y- File size: y is a boxed file name.
1!:55 y- File erase: y is a boxed file name.
3!:0 y- Storage type of the noun y, encoded as
2^i.6for boolean, literal, integer, floating, complex, boxed. 3!:1 y- Convert to internal representation (of a noun y).
3!:2 y- Convert from internal representation.
4!:0 y- Name class of boxed name, encoded as
i.7for undefined (but valid), label, noun, verb, adverb, conjunction, other. [x] 4!:1 y- Name list: result is a list of boxed names belonging to the classes 1 to 5 (as shown in
4!:0) in y. The optional left argument lists the initial letters of names to be included. 4!:55 y- The boxed name y is erased.
5!:0 y- Fix: (Inverse of
5!:1and5!:2). 5!:1 y- Canonical representation.
5!:2 y- The boxed representation of a boxed name y.
6!:0 y- Time stamp: the current time as a list in the order YMD HMS. The last element may be fractional.
6!:1 y- Time since start of session.
6!:2 y- Time required to execute the sentence y.
6!: 3 y- Delay for y seconds.
7!:0 y- Space currently in use.
7!:1 y- Space used since start of session.
7!:2 y- Space required to execute the sentence y.
128!:0 y- QR decomposition of y in the domain of
%., giving a boxed Hermitian matrix and a boxed upper triangle. 128!:1- Invert square upper triangle.
Table 1: Language Summary¶
. |
: |
Page | ||
|---|---|---|---|---|
= |
Classify ; Equal | Is (Local) | Is (Global) | 5 |
< |
Box ; LessThan | Floor ; LesserOf | Decrem ; LsOrEq | |
> |
Open ; LargerThan | Ceiling ; LargerOf | Increment ; LgOrEq | 6 |
_ |
NegSign/Infinity | |||
+ |
Conjugate ; Plus | ; GCD (Or) | ; Nor | |
* |
Signum ; Times | ; LCM (And) | ; Nand | |
- |
Negate ; Minus | Not (1-) ; Less | ; Match | |
% |
Recip ; Divide | MatrixInv ; MDiv | Sqrt ; Root | 7 |
^ |
Exp ; Power | NaturalLog ; Log | Power ; Chain | |
$ |
ShapeOf ; Shape | Suite | SelfReference | |
~ |
Both ; Cross | Nub ; | Nubsieve ; NotEq | |
\| |
Mag ; Residue | Reverse ; Rotate | Transpose | 8 |
. |
Determ ; DotProd | |||
: |
Obverse | Definition | 9 | |
, |
Ravel ; Append | Raze ; | Itemize ; Laminate | |
; |
RavelItems ; Link | Cut | Words ; | 10 |
# |
Tally ; Copy | Base2 ; Base | Ant2 ; Antibase | 11 |
@ |
Atop | Dir-Cyc ; Permute | AtomPermute | |
/ |
Insert ; Table | Oblique ; Key | GradeUp ; Sort | 12 |
\ |
Prefix ; Infix | Suffix ; Outfix | GrDown ; Sort | |
{ |
Catalog ; From | First ; Take | Right (Dex) | 13 |
} |
Merge | Rest ; Drop | Left (Lev) | |
" |
Rank | Execute ; Execute | Format ; Format | 14 |
& |
With | Under | Custom | |
! |
Factorial ; OutOf | External | 15 | |
? |
Roll ; Deal | |||
) |
Label-Cmd (Appendix A) | |||
a |
Alphabet | |||
e |
Razein ; Member | |||
i |
Integers ; IndexOf | |||
o |
PiTimes ; Circular | |||
x |
First Argument | 16 | ||
y |
Last Argument | |||
E |
; MemberOfInterval |
Table 2: Parsing Rules¶
[=(av |
v | n | & | Monad | |
| c | n | v | n | Monad | |
[=(avn |
n | v | n | Dyad | |
[=(avn |
nv | a | & | Adverb | |
[=(avn |
nv | c | nv | Conjunction | |
[=(avn |
v | v | v | Fork | |
[=( |
v | v | & | Hook | |
| np | = | cavn= | & | Is | |
| ( | cavn | ) | & | Punctuation | |
| & | & | & | & | Get next |
LEGEND: a Adv; c Conj; n Noun; p Pronoun; v Verb; [ Lmark; = Is; ( Lparen; ) Rparen; & Any