latin: url metadata for patented stroke entries
[sheet.git] / apl.inc.pl
1 use utf8;
2 ( # dyadic, monadic
3
4 # arithmetic
5 ["+\n-", "add\nSum of A and B", "conjugate\nNo change to B"],
6 ["−\n_", "subtract\nA minus B", "negate\nChanges sign of B"],
7 ["×\n-", "multiply\nA multiplied by B", "sign\n¯1 if B<0; 0 if B=0; 1 if B>0"],
8 ["÷\n=", "divide\nA divided by B", "reciprocal\n1 divided by B"],
9 ["∣\nm", "residue\nRemainder of division: B modulo A", "magnitude\nAbsolute value of B"],
10 ["⋆\np", "power\nA raised to the B power", "exponential\ne to the B power"],
11 ["⍟\n*", "logarithm\nLogarithm of B to base A", "natural logarithm\nNatural logarithm of B"],
12 ["○\no", "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 ["⌈\ns", "maximum\nThe greater value of A or B", "ceiling\nLeast integer greater than or equal to B"],
14 ["⌊\nd", "minimum\nThe smaller value of A or B", "floor\nGreatest integer less than or equal to B"],
15 ["!", "binomial\nNumber of combinations of B taken A at a time", "factorial\nProduct of integers 1 to B"],
16 ["?\nq", "deal\nA distinct integers selected randomly from the first B integers", "roll\nOne integer selected randomly from the first B integers"],
17
18 undef,
19
20 # logical
21 ["∼\nt", "difference\nItems found in B are removed from A", "not\nLogical: ∼1 is 0, ∼0 is 1"],
22 ["∨\n9", "or\nLogic: 0 if A and B are 0; 1 otherwise"],
23 ["∧\n0", "and\nLogic: 1 if A and B are 1; 0 otherwise"],
24 ["⍱\n(", "nor\nLogic: 1 if both A and B are 0; otherwise 0"],
25 ["⍲\n)", "nand\nLogic: 0 if both A and B are 1; otherwise 1"],
26
27 # comparative
28 ["<\n3", "less than\nComparison: 1 if true, 0 if false"],
29 ["≤\n4", "less than or equal\nComparison: 1 if true, 0 if false"],
30 ["=\n5", "equal\nComparison: 1 if true, 0 if false"],
31 ["≥\n6", "greater than or equal\nComparison: 1 if true, 0 if false"],
32 [">\n7", "greater than\nComparison: 1 if true, 0 if false"],
33 ["≠\n8", "not equal\nComparison: 1 if true, 0 if false"],
34 ["≡\n:", "match\n1 if arguments are the same in every respect, 0 if not", "depth\nLevel of nesting: 1 + maximum array depth or 0 if scalar"],
35 ["≢\n\"", "not match\n1 if arguments are different if any respect, 0 if not", "tally\nNumber of major cells in B, equivalent to {⍬⍴ (⍴⍵),1}"],
36
37 undef,
38
39 # vector
40 ["∈\ne", "membership\n1 for elements of A present in B; 0 where not", "enlist\nEvery element in B as simple vector"],
41 ["⍷\nE", "find\nElements of A within B, returning 1 if the start of A is found in B"],
42 ["⌷\nL", "index", "materialise"],
43 ["⍬\n}", undef, "zilde\nEmpty numeric vector, equivalent to ⍳0 or 0⍴0"],
44 ["⍳\ni", "index of\nThe location (index) of B in A; 1+⌈/⍳⍴A if not found", "count\nVector of the first B integers"],
45 ["⍸\nI", "string index\nThe index of B in A using ⍷ as primary function"],
46 ["⍴\nr", "reshape\nArray of shape A with data B", "shape\nNumber of components in each dimension of B"],
47
48 # selection
49 ["⊢\n\\", "right\nDiscard A and pass B unchanged", "pass\nPasses argument unchanged, useful to force display of non-printing result"],
50 ["⊣\n|", "left\nDiscard B and pass A unchanged", "stop\nDiscard argument and return empty matrix"],
51 ["⋄\n`", "statement separator\nSeparates multiple statements on a single line"],
52 ["↑\ny", "take\nSelect the first (or last) A elements of B according to ×A", "nub"],
53 ["↓\nu", "drop\nRemove the first (or last) A elements of B according to ×A", "split"],
54
55 # set
56 ["⊂\nz", "partition\nDivide B into an array of vectors according to specification in A", "enclose\nProduce a scalar of vector B"],
57 ["⊃\nx", "pick\nSelect item A from vector B", "disclose\nProduce an array made up of the items in B"],
58 ["⊆", "subset\nElements in both A and B: (∧/A∈B)∧(∧/B∈A)"],
59 ["∩\nc", "intersection\nElements of A that are in B: (A∈B)/A"],
60 ["∪\nv", "union\nCatenate A and B determined by combining ranks: A,(∼A∈B)/A", "unique"],
61 [",", "catenate\nElements of B appended to the elements of A", "ravel\nReshapes B into a vector"],
62 ["⍪\n<", "catenate first\nCatenate across the first axis"],
63
64 # transform
65 ["⌹\n+", "matrix divide\nSolution to system of linear equations, multiple regression Ax = B", "matrix inverse\nInverse of matrix B"],
66 ["⌽\n%", "rotate first\nThe elements of B are rotated A positions", "reverse first\nReverse elements of B along last axis"],
67 ["⊖\n&", "rotate\nThe elements of B are rotated A positions along the first axis", "reverse\nReverse elements of B along first axis"],
68 ["⍉\n^", "general transpose\nThe axes of B are ordered by A", "monadic transpose\nReverse the axes of B"],
69
70 undef,
71
72 # sorting and coding
73 ["⍋\n\$", "grade up\nArrange B according to collating sequence specified by A", "grade up\nIndices of B which will arrange B in ascending order"],
74 ["⍒\n#", "grade down\nArrange B according to inverse collating sequence specified by A", "grade down\nIndices of B which will arrange B in descending order"],
75 ["⊤\nn", "encode\nBase-A representation of the value of B"],
76 ["⊥\nb", "decode\nValue of a polynomial whose coefficients are B at A"],
77
78 # miscellaneous
79 ["⍺", "picture format\nDisplays the numbers in B according to the instructions in A", "alpha"],
80 ["⍕\n'", "specified format\nFormat B into a character matrix according to A", "format\nConvert to characters according to default display rules"],
81 ["⍎\n;", "execute", "execute\nExecute an APL expression"],
82 ["⎕\nl", undef, "evaluated I/O\nRead number or expression typed on the keyboard or display result with newline"],
83 ["⍞\n{", undef, "bare I/O\nRead data typed on the keyboard as characters or display without terminating newline"],
84 [")", undef, "hook"],
85 ["→\n]", undef, "goto\n→This_Label sends APL execution to This_Label:"],
86 ["←\n[", undef, "assign\nB←A sets values and shape of B to match A"],
87 ["⍝\n,", undef, "comment\nEverything to the right of ⍝ denotes a comment"],
88
89 ["_\nf"],
90 ["∆\nh", "difference", "derivative"],
91 ["∇\ng", undef, "edit\nToggle function definition mode"],
92 ["⍫\n@", undef, "lock\nEdit a function which cannot be edited or displayed"],
93 ["'\nk"],
94 ["⍙\n>"],
95
96 undef,
97
98 # operators
99 ["\\","expand\nInsert zeros (or blanks) in B corresponding to zeros in A", "scan\nRunning sum across B"],
100 ["⍀\n.", "expand first", "scan first\nRunning sum down B"],
101 ["/", "replicate\nSelect elements in B corresponding to ones in A", "reduce\nSum across B"],
102 ["⌿\n/", "replicate first", "reduce first\nSum down B"],
103
104 # array
105 ["¯\n2", undef, "negative\nDenotes a negative number"],
106 ["∝\na"],
107 ["⍵\nw", "omega"],
108
109 # monadic
110 ["¨\n1", "each\nOver each, or perform each separately; B = on these; A = operation to perform or using (e.g. iota)"],
111 ["⍨\nT", "commute\nExchanges the arguments of a dyadic function: A+⍨B ↔ B+A"],
112 ["&", undef, "spawn"],
113 ["⌶\n!", undef, "I-beam"],
114
115 # dyadic
116 ["⍠\n?", "variant"],
117 ["⌸", "key\nApply function to each unique key in A and major cells of B having that key", "key\nApply function A to each unique key in B and elements of ⍳≢B having that key"],
118 ["⍣\nP", "reapply\nThe function A is applied B times"],
119 [".", "inner product\nMatrix product of A and B"],
120 ["∘.\nj", "outer product\nOuter product of A and B"],
121 ["∘\nj", "compose"],
122 ["⍤\nJ", "rank\nApply function successively to the sub-arrays in B specified by k"],
123 ["⍥\nO", "coax"],
124
125 );