apl: page to list common APL symbols and meanings
[sheet.git] / apl.inc.pl
1 use utf8;
2 (
3 # monadic
4 ["∼", undef, "Not, Tilde\nLogical: ∼1 is 0, ∼0 is 1"],
5
6 # dyadic, monadic
7 ["+", "Add\nSum of A and B", "Identity\nNo change to B"],
8 ["−", "Subtract\nA minus B", "Negation\nChanges sign of B"],
9 ["×", "Multiply\nA multiplied by B", "Signum\n¯1 if B<0; 0 if B=0; 1 if B>0"],
10 ["÷", "Divide\nA divided by B", "Reciprocal\n1 divided by B"],
11 ["⋆", "Exponentiation\nA raised to the B power", "Exponential\ne to the B power"],
12 ["○", "Circle\nTrigonometric functions of B selected by A\nA=1: sin(B) A=2: cos(B) A=3: tan(B)", "Pi times\nMultiply by π"],
13 ["?", "Deal\nA distinct integers selected randomly from the first B integers", "Roll\nOne integer selected randomly from the first B integers"],
14 ["∈", "Membership, Epsilon\n1 for elements of A present in B; 0 where not."],
15 ["⌈", "Maximum, Ceiling\nThe greater value of A or B", "Ceiling\nLeast integer greater than or equal to B"],
16 ["⌊", "Minimum, Floor\nThe smaller value of A or B", "Floor\nGreatest integer less than or equal to B"],
17 ["⍴", "Reshape, Dyadic Rho\nArray of shape A with data B", "Shape, Rho\nNumber of components in each dimension of B"],
18 ["↑", "Take\nSelect the first (or last) A elements of B according to ×A"],
19 ["↓", "Drop\nRemove the first (or last) A elements of B according to ×A"],
20 ["⊥", "Decode\nValue of a polynomial whose coefficients are B at A"],
21 ["⊤", "Encode\nBase-A representation of the value of B"],
22 ["∣", "Residue\nB modulo A", "Absolute value\nMagnitude of B"],
23 [",", "Catenation\nElements of B appended to the elements of A", "Ravel, Catenate, Laminate\nReshapes B into a vector"],
24 ["\\","Expansion, Dyadic Backslash\nInsert zeros (or blanks) in B corresponding to zeros in A", "Scan (last axis), Backslash\nRunning sum across B"],
25 ["⍀", undef, "Scan (first axis)\nRunning sum down B"],
26 ["/", "Compression, Dyadic Slash\nSelect elements in B corresponding to ones in A", "Reduce (last axis), Slash\nSum across B"],
27 ["⌿", undef, "Reduce (first axis)\nSum down B"],
28 ["⍳", "Index of, Dyadic Iota\nThe location (index) of B in A; 1+⌈/⍳⍴A if not found", "Index generator, Iota\nVector of the first B integers"],
29 ["⌹", "Matrix divide, Dyadic Quad Divide\nSolution to system of linear equations, multiple regression Ax = B", "Matrix inverse, Monadic Quad Divide\nInverse of matrix B"],
30 ["⌽", "Rotation\nThe elements of B are rotated A positions", "Reversal\nReverse elements of B along last axis"],
31 ["⊖", "Rotation\nThe elements of B are rotated A positions along the first axis", "Reversal\nReverse elements of B along first axis"],
32 ["⍟", "Logarithm\nLogarithm of B to base A", "Logarithm\nNatural logarithm of B"],
33 ["⍋", undef, "Grade up\nIndices of B which will arrange B in ascending order"],
34 ["⍒", undef, "Grade down\nIndices of B which will arrange B in descending order"],
35 ["⍎", undef, "Execute\nExecute an APL expression"],
36 ["⍕", "Dyadic formatting\nFormat B into a character matrix according to A", "Monadic formatting\nA character representation of B"],
37 ["⍉", "General transpose\nThe axes of B are ordered by A", "Monadic transpose\nReverse the axes of B"],
38 ["!", "Combinations\nNumber of combinations of B taken A at a time", "Factorial \nProduct of integers 1 to B"],
39 ["¨", "Diaeresis, Double-Dot\nOver each, or perform each separately; B = on these; A = operation to perform or using(e.g. iota)"],
40 ["<", "Less than\nComparison: 1 if true, 0 if false"],
41 ["≤", "Less than or equal\nComparison: 1 if true, 0 if false"],
42 ["=", "Equal\nComparison: 1 if true, 0 if false"],
43 ["≥", "Greater than or equal\nComparison: 1 if true, 0 if false"],
44 [">", "Greater than\nComparison: 1 if true, 0 if false"],
45 ["≠", "Not equal\nComparison: 1 if true, 0 if false"],
46 ["∨", "Or\nLogic: 0 if A and B are 0; 1 otherwise"],
47 ["∧", "And\nLogic: 1 if A and B are 1; 0 otherwise"],
48 ["⍱", "Nor\nLogic: 1 if both A and B are 0; otherwise 0"],
49 ["⍲", "Nand\nLogic: 0 if both A and B are 1; otherwise 1"],
50
51 # operators and axis indicator
52 [".", undef, "Inner product\nMatrix product of A and B"],
53 ["∘.", undef, "Outer product\nOuter product of A and B"],
54
55 # miscellaneous
56 ["¯", undef, "High minus\nDenotes a negative number"],
57 ["⍝", undef, "Lamp, Comment\nEverything to the right of ⍝ denotes a comment"],
58 ["→", undef, "RightArrow, Branch, GoTo\n→This_Label sends APL execution to This_Label:"],
59 ["←", undef, "Assign, LeftArrow, Set to\nB←A sets values and shape of B to match A"],
60 ["⎕", undef, "Quad"],
61 [")", undef, "Hook"],
62 );