APL in R by Jan de Leeuw and Masanao Yajima.
From the introduction:
APL was introduced by Iverson (1962). It is an array language, with many functions to manipulate multidimensional arrays. R also has multidimensional arrays, but not as many functions to work with them.
In R there are no scalars, there are vectors of length one. For a vector
x
in R we havedim(x)
equal toNULL
andlength(x) > 0
. For an array, including a matrix, we havelength(dim(x)) > 0
. APL is an array language, which means everything is an array. For each array both the shape ⍴A and the rank ⍴⍴A are defined. Scalars are arrays with shape equal to one, vectors are arrays with rank equal to one.If you want to evaluate APL expressions using a traditional APL virtual keyboard, we recommend the nice webpage at ngn.github.io/apl/web/index.html. EliStudio at fastarray.appspot.com/default.html is essentially an APL interpreter running in a Qt GUI, using ascii symbols and symbol-pairs to replace traditional APL symbols (Chen and Ching (2013)). Eli does not have nested arrays. It does have ecc, which compiles eli to C.
In 1994 one of us coded most APL array operations in
XLISP-STAT
. The code is still available at gifi.stat.ucla.edu/apl.…
Certain this will be useful for R programmers but more generally curious if there is a genealogy of functions across programming languages?
Enjoy!
*Apologies to William Faulkner.