Direct function
A direct function (dfn, pronounced "dee fun") is an alternative way to define a function and operator (a higher-order function) in the programming language APL. A direct operator can also be called a dop (pronounced "dee op"). They were invented by John Scholes in 1996.[1] They are a unique combination of array programming, higher-order function, and functional programming, and are a major distinguishing advance of early 21st century APL over prior versions.
A dfn is a sequence of possibly guarded expressions (or just a guard) between {
and }
, separated by โ
or new-lines, wherein โบ
denotes the left argument and โต
the right, and โ
denotes recursion (function self-reference). For example, the function PT
tests whether each row of โต
is a Pythagorean triplet (by testing whether the sum of squares equals twice the square of the maximum).
PTโ {(+/โต*2)=2ร(โ/โต)*2}
PT 3 4 5
1
x
4 5 3
3 11 6
5 13 12
17 16 8
11 12 4
17 15 8
PT x
1 0 1 0 0 1
The factorial function as a dfn:
factโ {0=โต:1 โ โตรโ โต-1}
fact 5
120
factยจ โณ10 โ fact applied to each element of 0 to 9
1 1 2 6 24 120 720 5040 40320 362880
Description
[edit]The rules for dfns are summarized by the following "reference card":[2]
{โบ function โต}
|
{โบโบ operator โตโต}
|
: guard
|
โบ left argument
|
โบโบ left operand
|
:: error-guard
|
โต right argument
|
โตโต right operand
|
โบโ default left argument
|
โ self-reference
|
โโ self-reference
|
sโ shy result
|
A dfn is a sequence of possibly guarded expressions (or just a guard) between {
and }
, separated by โ
or new-lines.
expression
guard: expression
guard:
The expressions and/or guards are evaluated in sequence. A guard must evaluate to a 0 or 1; its associated expression is evaluated if the value is 1. A dfn terminates after the first unguarded expression which does not end in assignment, or after the first guarded expression whose guard evaluates to 1, or if there are no more expressions. The result of a dfn is that of the last evaluated expression. If that last evaluated expression ends in assignment, the result is "shy"โnot automatically displayed in the session.
Names assigned in a dfn are local by default, with lexical scope.
โบ
denotes the left function argument and โต
the right; โบโบ
denotes the left operand and โตโต
the right. If โตโต
occurs in the definition, then the dfn is a dyadic operator; if only โบโบ
occurs but not โตโต
, then it is a monadic operator; if neither โบโบ
or โตโต
occurs, then the dfn is a function.
The special syntax โบโexpression
is used to give a default value to the left argument if a dfn is called monadically, that is, called with no left argument. The โบโexpression
is not evaluated otherwise.
โ
denotes recursion or self-reference by the function, and โโ
denotes self-reference by the operator. Such denotation permits anonymous recursion.
Error trapping is provided through error-guards, errnums::expression
. When an error is generated, the system searches dynamically through the calling functions for an error-guard that matches the error. If one is found, the execution environment is unwound to its state immediately prior to the error-guard's execution and the associated expression of the error-guard is evaluated as the result of the dfn.
Additional descriptions, explanations, and tutorials on dfns are available in the cited articles.[3][4][5][6][7]
Examples
[edit]The examples here illustrate different aspects of dfns. Additional examples are found in the cited articles.[8][9][10]
Default left argument
[edit]The function {โบ+0j1รโต}
adds โบ
to 0j1
(i or ) times โต
.
3 {โบ+0j1รโต} 4
3J4
โ.{โบ+0j1รโต}โจ ยฏ2+โณ5
ยฏ2Jยฏ2 ยฏ2Jยฏ1 ยฏ2 ยฏ2J1 ยฏ2J2
ยฏ1Jยฏ2 ยฏ1Jยฏ1 ยฏ1 ยฏ1J1 ยฏ1J2
0Jยฏ2 0Jยฏ1 0 0J1 0J2
1Jยฏ2 1Jยฏ1 1 1J1 1J2
2Jยฏ2 2Jยฏ1 2 2J1 2J2
The significance of this function can be seen as follows:
Complex numbers can be constructed as ordered pairs of real numbers, similar to how integers can be constructed as ordered pairs of natural numbers and rational numbers as ordered pairs of integers. For complex numbers,
{โบ+0j1รโต}
plays the same role as-
for integers andรท
for rational numbers.[11]:โยง8โ
Moreover, analogous to that monadic -โต
โ 0-โต
(negate) and monadic รทโต
โ 1รทโต
(reciprocal), a monadic definition of the function is useful, effected by specifying a default value of 0 for โบ
: if jโ{โบโ0 โ โบ+0j1รโต}
, then j โต
โ 0 j โต
โ 0+0j1รโต
.
jโ{โบโ0 โ โบ+0j1รโต}
3 j 4 ยฏ5.6 7.89
3J4 3Jยฏ5.6 3J7.89
j 4 ยฏ5.6 7.89
0J4 0Jยฏ5.6 0J7.89
sinโ 1โโ
cosโ 2โโ
Eulerโ {(*j โต) = (cos โต) j (sin โต)}
Euler (ยฏ0.5+?10โด0) j (ยฏ0.5+?10โด0)
1 1 1 1 1 1 1 1 1 1
The last expression illustrates Euler's formula on ten random numbers with real and imaginary parts in the interval .
Single recursion
[edit]The ternary construction of the Cantor set starts with the interval [0,1] and at each stage removes the middle third from each remaining subinterval:
The Cantor set of order โต
defined as a dfn:[11]:โยง2.5โ
Cantorโ {0=โต:,1 โ ,1 0 1 โ.โง โ โต-1}
Cantor 0
1
Cantor 1
1 0 1
Cantor 2
1 0 1 0 0 0 1 0 1
Cantor 3
1 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1
Cantor 0 to Cantor 6 depicted as black bars:
The function sieve โต
computes a bit vector of length โต
so that bit i
(for 0โคi
and i<โต
) is 1 if and only if i
is a prime.[10]:โยง46โ
sieveโ{
4โฅโต:โตโด0 0 1 1
rโโ0.5*โจnโโต
pโ2 3 5 7 11 13 17 19 23 29 31 37 41 43
pโ(1+(nโครโp)โณ1)โp
bโ 0@1 โ {(mโดโต)>mโดโบโ1 โฃ mโnโโบรโขโต}โฟ โ1,p
{r<qโbโณ1:bโฃb[โต]โ1 โ b[q,qรโธbโโจโnรทq]โ0 โ โ โต,q}p
}
10 10 โด sieve 100
0 0 1 1 0 1 0 1 0 0
0 1 0 1 0 0 0 1 0 1
0 0 0 1 0 0 0 0 0 1
0 1 0 0 0 0 0 1 0 0
0 1 0 1 0 0 0 1 0 0
0 0 0 1 0 0 0 0 0 1
0 1 0 0 0 0 0 1 0 0
0 1 0 1 0 0 0 0 0 1
0 0 0 1 0 0 0 0 0 1
0 0 0 0 0 0 0 1 0 0
bโsieve 1e9
โขb
1000000000
(10*โณ10) (+โฟโ)โค0 1 โขb
0 4 25 168 1229 9592 78498 664579 5761455 50847534
The last sequence, the number of primes less than powers of 10, is an initial segment of OEIS: A006880. The last number, 50847534, is the number of primes less than . It is called Bertelsen's number, memorably described by MathWorld as "an erroneous name erroneously given the erroneous value of ".[12]
sieve
uses two different methods to mark composites with 0s, both effected using local anonymous dfns: The first uses the sieve of Eratosthenes on an initial mask of 1 and a prefix of the primes 2 3...43, using the insert operator โฟ
(right fold). (The length of the prefix obtains by comparison with the primorial function รโp
.) The second finds the smallest new prime q
remaining in b
(qโbโณ1
), and sets to 0 bit q
itself and bits at q
times the numbers at remaining 1 bits in an initial segment of b
(โธbโโจโnรทq
). This second dfn uses tail recursion.
Tail recursion
[edit]Typically, the factorial function is define recursively (as above), but it can be coded to exploit tail recursion by using an accumulator left argument:[13]
facโ{โบโ1 โ โต=0:โบ โ (โบรโต) โ โต-1}
Similarly, the determinant of a square complex matrix using Gaussian elimination can be computed with tail recursion:[14]
detโ{ โ determinant of a square complex matrix
โบโ1 โ product of co-factor coefficients so far
0=โขโต:โบ โ result for 0-by-0
(i j)โ(โดโต)โคโโ|,โต โ row and column index of the maximal element
kโโณโขโต
(โบรโต[i;j]รยฏ1*i+j) โ โต[k~i;k~j] - โต[k~i;j] โ.ร โต[i;k~j]รทโต[i;j]
}
Multiple recursion
[edit]A partition of a non-negative integer is a vector of positive integers such that n = +โฟv
, where the order in is not significant. For example, 2 2
and 2 1 1
are partitions of 4, and 2 1 1
and 1 2 1
and 1 1 2
are considered to be the same partition.
The partition function counts the number of partitions. The function is of interest in number theory, studied by Euler, Hardy, Ramanujan, Erdลs, and others. The recurrence relation
derived from Euler's pentagonal number theorem.[15] Written as a dfn:[10]:โยง16โ
pn โ {1โฅโต:0โคโต โ -โฟ+โฟโยจrec โต}
rec โ {โต - (รทโ2 (รโค1) ยฏ1 1 โ.+ 3โร) 1+โณโ0.5*โจโตร2รท3}
pn 10
42
pnยจ โณ13 โ OEIS A000041
1 1 2 3 5 7 11 15 22 30 42 56 77
The basis step 1โฅโต:0โคโต
states that for 1โฅโต
, the result of the function is 0โคโต
, 1 if โต is 0 or 1 and 0 otherwise. The recursive step is highly multiply recursive. For example, pn 200
would result in the function being applied to each element of rec 200
, which are:
rec 200
199 195 188 178 165 149 130 108 83 55 24 ยฏ10
198 193 185 174 160 143 123 100 74 45 13 ยฏ22
and pn 200
requires longer than the age of the universe to compute ( function calls to itself).[10]:โยง16โ The compute time can be reduced by memoization, here implemented as the direct operator (higher-order function) M
:
Mโ{
fโโบโบ
iโ2+'โ'โณโจtโ2โ,โcr 'f'
โ'{Tโ(1+โต)โดยฏ1 โ ',(iโt),'ยฏ1โขT[โต]:โT[โต] โ โT[โต]โโ',(iโt),'โต}โต'
}
pn M 200
3.973E12
0 โ pn M 200 โ format to 0 decimal places
3972999029388
This value of pn M 200
agrees with that computed by Hardy and Ramanujan in 1918.[16]
The memo operator M
defines a variant of its operand function โบโบ
to use a cache T
and then evaluates it. With the operand pn
the variant is:
{Tโ(1+โต)โดยฏ1 โ {1โฅโต:0โคโต โ ยฏ1โขT[โต]:โT[โต] โ โT[โต]โโ-โฟ+โฟโยจrec โต}โต}
Direct operator (dop)
[edit]Quicksort on an array โต
works by choosing a "pivot" at random among its major cells, then catenating the sorted major cells which strictly precede the pivot, the major cells equal to the pivot, and the sorted major cells which strictly follow the pivot, as determined by a comparison function โบโบ
. Defined as a direct operator (dop) Q
:
Qโ{1โฅโขโต:โต โ (โ โตโฟโจ0>s)โช(โตโฟโจ0=s)โชโ โตโฟโจ0<sโโต โบโบ โตโทโจ?โขโต}
โ precedes โ follows โ equals
2 (ร-) 8 8 (ร-) 2 8 (ร-) 8
ยฏ1 1 0
xโ 2 19 3 8 3 6 9 4 19 7 0 10 15 14
(ร-) Q x
0 2 3 3 4 6 7 8 9 10 14 15 19 19
Q3
is a variant that catenates the three parts enclosed by the function โ
instead of the parts per se. The three parts generated at each recursive step are apparent in the structure of the final result. Applying the function derived from Q3
to the same argument multiple times gives different results because the pivots are chosen at random. In-order traversal of the results does yield the same sorted array.
Q3โ{1โฅโขโต:โต โ (โโ โตโฟโจ0>s)โช(โโตโฟโจ0=s)โชโโ โตโฟโจ0<sโโต โบโบ โตโทโจ?โขโต}
(ร-) Q3 x
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโฌโ
โโโโโโโโโโโโโโโโโฌโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโ19 19โโ
โโโโโโโโโโฌโโโโฌโโโ6โโโโโโโโโฌโโฌโโโโโโโโโโโโโโโโโ โโ
โโโโโฌโโฌโโโ3 3โ4โโ โโโโฌโโฌโโโ9โโโฌโโโฌโโโโโโโโโโโโ โโ
โโโโโ0โ2โโ โ โโ โโโโ7โ8โโ โโโ10โโโโโฌโโโฌโโโโโ โโ
โโโโโดโโดโโโ โ โโ โโโโดโโดโโโ โโโ โโ14โ15โโโโโโ โโ
โโโโโโโโโโดโโโโดโโโ โโ โ โโโ โโโโโดโโโดโโโโโ โโ
โโ โ โโ โ โโโดโโโดโโโโโโโโโโโโ โโ
โโ โ โโโโโโโโโดโโดโโโโโโโโโโโโโโโโโ โโ
โโโโโโโโโโโโโโโโโดโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโดโ
(ร-) Q3 x
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโฌโโฌโโโโโโโโโโโโโโโโโโโโโโโโ7โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโฌโโ
โโโ0โโโฌโโฌโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโฌโโโโโโโโโโ19 19โโโ
โโโ โโโ2โโโโโโโโโโโโโโโฌโโฌโโโโ โโโโโฌโโฌโโโ10โโโโโฌโโโฌโโโ โโโ
โโโ โโโ โโโโโโโโโโโฌโโฌโโ6โโโโโ โโโโโ8โ9โโ โโ14โ15โโโโ โโโ
โโโ โโโ โโโโโฌโโโโฌโโ4โโโ โโโโโ โโโโโดโโดโโโ โโโโโดโโโดโโโ โโโ
โโโ โโโ โโโโโ3 3โโโ โโโ โโโโโ โโโโโโโโโโดโโโดโโโโโโโโโโ โโโ
โโโ โโโ โโโโโดโโโโดโโ โโโ โโโโโ โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโดโโ
โโโ โโโ โโโโโโโโโโโดโโดโโ โโโโโ โ โ
โโโ โโโ โโโโโโโโโโโโโโโดโโดโโโโ โ โ
โโโ โโโดโโดโโโโโโโโโโโโโโโโโโโโ โ โ
โโโดโโดโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The above formulation is not new; see for example Figure 3.7 of the classic The Design and Analysis of Computer Algorithms.[17] However, unlike the pidgin ALGOL program in Figure 3.7, Q
is executable, and the partial order used in the sorting is an operand, the (ร-)
the examples above.[9]
Dfns with operators and trains
[edit]Dfns, especially anonymous dfns, work well with operators and trains. The following snippet solves a "Programming Pearls" puzzle:[18] given a dictionary of English words, here represented as the character matrix a
, find all sets of anagrams.
a {โต[โโต]}โค1 โขa ({โต[โโต]}โค1 {โโต}โธ โข) a
pats apst โโโโโโฌโโโโโฌโโโโโ
spat apst โpatsโteasโstarโ
teas aest โspatโsateโ โ
sate aest โtapsโetasโ โ
taps apst โpastโseatโ โ
etas aest โ โeatsโ โ
past apst โ โtaseโ โ
seat aest โ โeastโ โ
eats aest โ โsetaโ โ
tase aest โโโโโโดโโโโโดโโโโโ
star arst
east aest
seta aest
The algorithm works by sorting the rows individually ({โต[โโต]}โค1 โขa
), and these sorted rows are used as keys ("signature" in the Programming Pearls description) to the key operator โธ
to group the rows of the matrix.[9]:โยง3.3โ The expression on the right is a train, a syntactic form employed by APL to achieve tacit programming. Here, it is an isolated sequence of three functions such that (f g h) โต
โ (f โต) g (h โต)
, whence the expression on the right is equivalent to ({โต[โโต]}โค1 โขa) {โโต}โธ a
.
Lexical scope
[edit]When an inner (nested) dfn refers to a name, it is sought by looking outward through enclosing dfns rather than down the call stack. This regime is said to employ lexical scope instead of APL's usual dynamic scope. The distinction becomes apparent only if a call is made to a function defined at an outer level. For the more usual inward calls, the two regimes are indistinguishable.[19]:โp.137โ
For example, in the following function which
, the variable ty
is defined both in which
itself and in the inner function f1
. When f1
calls outward to f2
and f2
refers to ty
, it finds the outer one (with value 'lexical'
) rather than the one defined in f1
(with value 'dynamic'
):
whichโ{
tyโ'lexical'
f1โ{tyโ'dynamic' โ f2 โต}
f2โ{ty,โต}
f1 โต
}
which ' scope'
lexical scope
Error-guard
[edit]The following function illustrates use of error guards:[19]:โp.139โ
plusโ{
txโ'catch all' โ 0::tx
txโ'domain' โ 11::tx
txโ'length' โ 5::tx
โบ+โต
}
2 plus 3 โ no errors
5
2 3 4 5 plus 'three' โ argument lengths don't match
length
2 3 4 5 plus 'four' โ can't add characters
domain
2 3 plus 3 4โด5 โ can't add vector to matrix
catch all
In APL, error number 5 is "length error"; error number 11 is "domain error"; and error number 0 is a "catch all" for error numbers 1 to 999.
The example shows the unwinding of the local environment before an error-guard's expression is evaluated. The local name tx
is set to describe the purview of its following error-guard. When an error occurs, the environment is unwound to expose tx
's statically correct value.
Dfns versus tradfns
[edit]Since direct functions are dfns, APL functions defined in the traditional manner are referred to as tradfns, pronounced "trad funs". Here, dfns and tradfns are compared by consideration of the function sieve
: On the left is a dfn (as defined above); in the middle is a tradfn using control structures; on the right is a tradfn using gotos (โ
) and line labels.
sieveโ{
4โฅโต:โตโด0 0 1 1
rโโ0.5*โจnโโต
pโ2 3 5 7 11 13 17 19 23 29 31 37 41 43
pโ(1+(nโครโp)โณ1)โp
bโ 0@1 โ {(mโดโต)>mโดโบโ1 โฃ mโnโโบรโขโต}โฟ โ1,p
{r<qโbโณ1:bโฃb[โต]โ1 โ b[q,qรโธbโโจโnรทq]โ0 โ โ โต,q}p
}
|
โ bโsieve1 n;i;m;p;q;r
:If 4โฅn โ bโnโด0 0 1 1 โ :Return โ :EndIf
rโโ0.5*โจn
pโ2 3 5 7 11 13 17 19 23 29 31 37 41 43
pโ(1+(nโครโp)โณ1)โp
bโ1
:For q :In p โ bโ(mโดb)>mโดqโ1 โฃ mโnโqรโขb โ :EndFor
b[1]โ0
:While rโฅqโbโณ1 โ b[q,qรโธbโโจโnรทq]โ0 โ pโชโq โ :EndWhile
b[p]โ1
โ
|
โ bโsieve2 n;i;m;p;q;r
โL10 โดโจ 4<n โ bโnโด0 0 1 1 โ โ0
L10:
rโโ0.5*โจn
pโ2 3 5 7 11 13 17 19 23 29 31 37 41 43
pโ(1+(nโคร\p)โณ1)โp
iโ0 โ bโ1
L20:
bโ(mโดb)>mโดp[i]โ1 โฃ mโnโp[i]รโขb
โL20 โดโจ (โขp)>iโ1+i
b[1]โ0
L30:
โL40 โดโจ r<qโbโณ1 โ b[q,qรโธbโโจโnรทq]โ0 โ pโชโq โ โL30
L40:
b[p]โ1
โ
|
- A dfn can be anonymous; a tradfn must be named.
- A dfn is named by assignment (
โ
); a tradfn is named by embedding the name in the representation of the function and applyingโfx
(a system function) to that representation. - A dfn is handier than a tradfn as an operand (see preceding items: a tradfn must be named; a tradfn is named by embedding ...).
- Names assigned in a dfn are local by default; names assigned in a tradfn are global unless specified in a locals list.
- Locals in a dfn have lexical scope; locals in a tradfn have dynamic scope, visible in called functions unless shadowed by their locals list.
- The arguments of a dfn are named
โบ
andโต
and the operands of a dop are namedโบโบ
andโตโต
; the arguments and operands of a tradfn can have any name, specified on its leading line. - The result (if any) of a dfn is unnamed; the result (if any) of a tradfn is named in its header.
- A default value for โบ is specified more neatly than for the left argument of a tradfn.
- Recursion in a dfn is effected by invoking
โ
orโโ
or its name; recursion in a tradfn is effected by invoking its name. - Flow control in a dfn is effected by guards and function calls; that in a tradfn is by control structures and
โ
(goto) and line labels. - Evaluating an expression in a dfn not ending in assignment causes return from the dfn; evaluating a line in a tradfn not ending in assignment or goto displays the result of the line.
- A dfn returns on evaluating an expression not ending in assignment, on evaluating a guarded expression, or after the last expression; a tradfn returns on
โ
(goto) line 0 or a non-existing line, or on evaluating a:Return
control structure, or after the last line. - The simpler flow control in a dfn makes it easier to detect and implement tail recursion than in a tradfn.
- A dfn may call a tradfn and vice versa; a dfn may be defined in a tradfn, and vice versa.
History
[edit]Kenneth E. Iverson, the inventor of APL, was dissatisfied with the way user functions (tradfns) were defined. In 1974, he devised "formal function definition" or "direct definition" for use in exposition.[20] A direct definition has two or four parts, separated by colons:
name : expression
name : expression0 : proposition : expression1
Within a direct definition, โบ
denotes the left argument and โต
the right argument. In the first instance, the result of expression
is the result of the function; in the second instance, the result of the function is that of expression0
if proposition
evaluates to 0, or expression1
if it evaluates to 1. Assignments within a direct definition are dynamically local. Examples of using direct definition are found in the 1979 Turing Award Lecture[21] and in books and application papers.[22][23][24][25][9]
Direct definition was too limited for use in larger systems. The ideas were further developed by multiple authors in multiple works[26]:โยง8โ[27][28]:โยง4.17โ[29][30][31][32] but the results were unwieldy. Of these, the "alternative APL function definition" of Bunda in 1987[31] came closest to current facilities, but is flawed in conflicts with existing symbols and in error handling which would have caused practical difficulties, and was never implemented. The main distillates from the different proposals were that (a) the function being defined is anonymous, with subsequent naming (if required) being effected by assignment; (b) the function is denoted by a symbol and thereby enables anonymous recursion.[9]
In 1996, John Scholes of Dyalog Limited invented direct functions (dfns).[1][6][7] The ideas originated in 1989 when he read a special issue of The Computer Journal on functional programming.[33] He then proceeded to study functional programming and became strongly motivated ("sick with desire", like Yeats) to bring these ideas to APL.[6][7] He initially operated in stealth because he was concerned the changes might be judged too radical and an unnecessary complication of the language; other observers say that he operated in stealth because Dyalog colleagues were not so enamored and thought he was wasting his time and causing trouble for people. Dfns were first presented in the Dyalog Vendor Forum at the APL '96 Conference and released in Dyalog APL in early 1997.[1] Acceptance and recognition were slow in coming. As late as 2008, in Dyalog at 25,[34] a publication celebrating the 25th anniversary of Dyalog Limited, dfns were barely mentioned (mentioned twice as "dynamic functions" and without elaboration). As of 2019[update], dfns are implemented in Dyalog APL,[19] NARS2000,[35] and ngn/apl.[36] They also play a key role in efforts to exploit the computing abilities of a graphics processing unit (GPU).[37][9]
References
[edit]- ^ a b c Scholes, John (October 1996). "Direct Functions in Dyalog APL" (PDF). Vector. 13 (2). Retrieved 16 September 2019.
- ^ Scholes, John (1998โ2019), Direct Functions Reference Card, retrieved 26 September 2019[permanent dead link]
- ^ Scholes, John (April 2001). "D: A Functional Subset of Dyalog APL". Vector. 17 (4). Retrieved 21 September 2019.
- ^ Scholes, John (13 September 2009). Introduction to D-functions: 1 of 2 (video). Dyalog '09 User Conference. Retrieved 21 September 2019.
- ^ Scholes, John (13 September 2009). Introduction to D-functions: 2 of 2 (video). Dyalog '09 User Conference. Retrieved 21 September 2019.
- ^ a b c Scholes, John (31 October 2018). DfnsโPast, Present and Future (video). Dyalog '18 User Meeting. Retrieved 21 September 2019.
- ^ a b c Scholes, John (31 October 2018), DfnsโPast, Present and Future (text) (PDF), Dyalog '18 User Meeting, retrieved 21 September 2019
- ^ Scholes, John (1998โ2019), Direct Functions Workspace, retrieved 2019-09-15
- ^ a b c d e f Hui, Roger; Kromberg, Morten (June 2020). "APL Since 1978". Proceedings of the ACM on Programming Languages. 4 (HOPL): 1โ108. doi:10.1145/3386319. S2CID 218517570.
- ^ a b c d Hui, Roger (27 November 2016), A History of APL in 50 Functions, retrieved 17 September 2019
- ^ a b Hui, Roger (18 July 2016), APL Exercises, retrieved 24 September 2019
- ^ Weisstein, Eric W., Bertelsen's Number, MathWorld, A Wolfram Web Resource, retrieved 26 September 2019
- ^ Scholes, John (1998โ2019), "Factorial", DFNS Workspace, retrieved 20 September 2019
- ^ Scholes, John (1998โ2019), "Determinant", DFNS Workspace, retrieved 20 September 2019
- ^ Weisstein, Eric W., Partition Function P, equation 11, MathWorld, A Wolfram Web Resource, retrieved 3 October 2019
- ^ Hardy, G.H.; Ramanujan, S. (1918), "Asymptotic Formulรฆ in Combinatory Analysis" (PDF), Proceedings of the London Mathematical Society, 17 (2), retrieved 24 December 2019
- ^ Aho, A.V.; Hopcroft, J.E.; Ullman, J.D. (1974), The Design and Analysis of Computer Algorithms, Addison-Wesley, Bibcode:1974daca.book.....A
- ^ Bentley, Jon (August 1983). "Programming Pearls". Communications of the ACM. 26 (8 and 9).
- ^ a b c Dyalog (15 August 2019). Dyalog Programming Reference Guide, version 17.1, Dfns & Dops, pp. 133-147 (PDF). Dyalog Ltd. Retrieved 30 September 2019.
- ^ Iverson, Kenneth E. (1974), "Chapter 10, Formal Function Definition", Elementary Functions, IBM Corporation, retrieved 18 September 2019
- ^ Iverson, Kenneth E. (August 1980). "Notation as a Tool of Thought". Communications of the ACM. 23 (8): 444โ465. doi:10.1145/358896.358899. Retrieved 8 April 2016.
- ^ Iverson, Kenneth E. (1976). Elementary Analysis. APL Press.
- ^ Orth, D.L. (1976). Calculus in a New Key. APL Press.
- ^ Hui, Roger (May 1987). "Some Uses of { and }". APL 87 Conference Proceedings. Retrieved 15 April 2016.
- ^ McDonnell, E.E. (May 1987), "Life: Nasty, Brutish, and Short", APL 87 Conference Proceedings, retrieved 6 October 2019[permanent dead link]
- ^ Iverson, Kenneth E. (26 April 1978), "Operators and Functions", Research Report Number #RC7091, IBM Corporation, retrieved 2019-09-19
- ^ Iverson, Kenneth E.; Wooster, Peter (September 1981). "A Function Definition Operator". APL81 Conference Proceedings, APL Quote Quad. 12 (1).
- ^ Cheney, Carl M. (March 1981), APL*Plus Nested Array System Reference Manual (PDF), STSC, Inc., retrieved 18 September 2019
- ^ Iverson, Kenneth E. (6 January 1983), Rationalized APL, I. P. Sharp Associates, retrieved 2019-09-19
- ^ Iverson, Kenneth E. (September 1987). "A Dictionary of APL". APL Quote Quad. 18 (1): 5โ40. doi:10.1145/36983.36984. S2CID 18301178. Retrieved 19 September 2019.
- ^ a b Bunda, John (May 1987). "APL Function Definition Notation". APL87 Conference Proceedings, APL Quote Quad. 17 (4).
- ^ Hui, Roger; et al. (July 1990). "APL\?". Conference proceedings on APL 90: For the future. Vol. 20. pp. 192โ200. doi:10.1145/97808.97845. ISBN 089791371X. S2CID 235453656. Retrieved 2019-09-10.
- ^ Wadler, Philip L.; et al. (1 January 1989). "Special Issue on Functional Programming". The Computer Journal. 32 (2).
- ^ Dyalog (September 2008). "Dyalog at 25" (PDF). Vector. Retrieved 2019-09-20.
- ^ Smith, Bob (2006โ2019), NARS2000, retrieved 18 September 2019
- ^ Nickolov, Nick (September 2013). "Compiling APL to JavaScript". Vector. 26 (1). Retrieved 19 September 2019.
- ^ Hsu, Aaron (2019). A Data Parallel Compiler Hosted on a GPU (PDF) (Ph.D. thesis). Indiana University. Retrieved 25 December 2019.
External links
[edit]- Official website, Dyalog