You are on page 1of 2

GNU APL Reference Card loads workspace (IBM .atf format) )IN F [O . . .

] right argument ~R
(for GNU APL version 1.8) show libraries and paths )LIBS [[L] path] random link ~RL
show saved workspaces )LIB [L|P] [from-to] shared variable event ~SVE
load workspace W )LOAD [L] W system limits ~SYL
show more error info )MORE terminal control characters ~TC
Use C-x gnu-apl to start GNU APL in Emacs. lists symbols matching name )NMS [from-to] time stamp (current time) ~TS
quit APL )OFF time zone (offset from GMT) ~TZ
show operators )OPS [from-to] user load ~UL
Emacs mode dump workspace (IBM .atf format) )OUT name [O . . .] axis argument ~X
protects during copying )PCOPY [L] W [O . . .] workspace available (bytes for workspace) ~WA
Interaction mode:
protects during loading )PIN F [O . . .] dfn axis argument X
beginning of defun C-M-a quiet load )QLOAD [[L] W] dfn result λ
end of defun C-M-e reset state indicator )RESET dfn left value arg α
find function at point M-. save workspace as W )SAVE [[L] W] dfn left function arg α
apropos symbol C-c C-a clear suspended functions )SIC dfn right value arg ω
edit function C-c C-f see suspended functions and locals )SINL dfn right function arg ω
show help for symbol C-c C-h see suspended functions )SIS System functions:
finnapl list C-c TAB state indicator )SI
show keyboard C-c C-k show symbol count )SYMBOLS [count] atomic function ~AF
plot line C-c RET show values in use by interpreter )VALUES attributes ~AT
edit variable C-c C-v show variables )VARS [from-to] char representation ~CR
trace C-c C-. get/set workspace ID )WSID [W] delay ~DL
D. Knuth’s dancing links ~DLX
Edit mode: GNU extension commands (mostly for debugging) execute alternate ~EA
go to beginning of defun C-M-a toggles boxing of values when printing ]BOXING [OFF|num] execute both ~EB
go to end of defun C-M-e toggle colored output ]COLOR [ON|OFF] execute controlled ~EC
find function at point M-. dump W in HTML file ]DOXY [path] environment ~ENV
apropos symbol C-c C-a expected error count in test suite ]EXPECT error_count event simulate ~ES
interactive send current function C-c C-c help ]HELP [primitive] expunge ~EX
help for symbol C-c C-h show keyboard layout ]KEYB fast Fourier transform ~FFT
finnapl list C-c TAB as )LIB, but shows fil eextensions ]LIB [L|P] [from-to] file I/O ~FIO
show keyboard C-c C-k show/set logging facilities ]LOG [G [ON|OFF]] FiX (FFI/call native functions) ~FX
interactive send buffer C-c C-l next testcase file ]NEXTFILE Gtk GUI ~GTK
interactive send region C-c C-s performance statistics ]PSTAT [CLEAR|SAVE] MAP ravel elements ~MAP
switch to interactive C-c C-z as )SIS, with more details ]SIS input from script ~INP
trace C-c C-. as )SI, with more details ]SI name association ~NA
indent C-M-q shared variables ]SVARS name class ~NC
describe internal details of symbol S ]SYMBOL S name list ~NL
System define user command ]USERCMD [ . . . ] plot a graph ~PLOT
toggle output coloring on console ]XTERM [ON|OFF] regular expression, regex ~RE string ~RE
Notation for commands: System variables: random APL value ~RVAL
character input/output } state indicator ~SI
F filename L library P path evaluated input/output ~ SQL functions ~SQL
G logging facility O object S symbol account information ~AI shared variable control ~SVC
W workspace command line arguments ~ARG shared variable offer ~SVO
atomic vector ~AV shared variable query ~SVQ
APL standard commands
comparison tolerance ~CT shared variable retraction ~SVR
check workspace intergity )CHECK event message ~EM shared variable state ~SVS
clear workspace )CLEAR event type ~ET STOP vector ~STOP
save workspace as CONTINUE and exit )CONTINUE format control ~FC transfer form ~TF
copies objects from given workspace )COPY [L] W [O . . .] index origin (indexes start: 1, can be set to ~IO TRACE vector ~TRACE
remove W )DROP [L] W 0)
unicode character ~UCS
dump W (readable, HTML escaped) )DUMP-HTML [[L] W] left argument ~L
dump W (readable APL) )DUMP [[L] W] line counters ~LC Notation
dump W (readable APL, verbose) )DUMPV [[L] W] latent expression (executed when workspace ~LX
erase symbol(s) )ERASE S . . . is loaded) comment 
show functions )FNS [from-to] print precision (number of digits) ~PP statement separator 
help )HELP [primitive] print style ~PS assignment A← . . .
history )HIST [CLEAR] print width (max characters in each printed ~PW assignment (A B C)← . . . . . . . . .
runs command on host )HOST command . . . line) function definition F
B−1 A (solution to Bx = A) ~B
A÷ rank: apply left operand function to ◦k B
A f¨
zilde (empty vector) ∼
O reverse elements of A (1st index) A cells specified by array on right
a +a rotate B by A positions A B axis: AfC, over Bth axis Af[B]C
a+b a+b reverse elements of A (last index) #|A commute 1-x over array A 1 − ∼A
¨
-a -a rotate B by A positions (last index) A#|B
a-b a-b drop first A elements of B A↓B ~CR, ~FIO, ~PLOT, ~SQL
magnitude of a |a select first A elements of B A↑B
b mod a a|b intersection A∩B
When called with an empty string as right argument, these will
signal (-1, 0, +1) ×a set (remove duplicates) ∪A
show a table with all their possible uses.
ab a×b union A∪B
1/a ÷a identity `A
a/b a÷b take right hand side (B) A`B Circle function
floor of a ba take left(Xi =0) or right(Xi =1) A`[X]B
min(a,b) abb null aA A A◦B A A◦B
ceiling of a da take left hand side (A) AaB √
max(a,b) adb i-th element of A A[i] 0 1-B × B
−1 arcsin B 1 sin B
ea *a elements of A with indices i, j, k, . . . A[i j k . . .]
−2 arccos B 2 cos B
ab a*b element of A w/indices i, j, . . . in 1st A[i . . .; k . . .; . . .]
−3 arctan B 3 tan B
log(a) a dimension, k, l, . . . in second, . . . p √
log b (a) ba −4 −1+B × B 4 1+B × B
first n non-negative integers ιn transpose of A A −5 arcsinh B 5 sinh B
transpose of B, axes ordered by A AB −6 arccosh B 6 cosh B
maps A: 1 for a∈ B, 0 for a∈/ B A∈B −7 arctanh B 7 tanh
a=b a=b pB
a<b a<b grade up A |A −8 −(8◦B) 8 ± −1+B × B
a>b a>b grade up B with elements of A as top A|B −9 B 9 real part of B
a≤b a≤b priority −10 +B 10 |B
a≥b a≥b grade down A F| A −11 0J1×B 11 imag part of B
expression max depth ≡a grade down B with elements of A as AF |B −12 *0J1×B (eiB ) 12 arc B (phase of B)
match (value and type) a≡b low priority
transpose of A A For A= 8, the sign before the square root is opposite of B.
expression min depth 6≡ a
not match a 6≡ b enclose A ⊂A
not a ∼
∗a enclose B with selected elements given A⊂ B Function Definition
a or b a∨b the binary vector A
disclose A ⊃A 1/d
a and b a∧b Example: f (d, v) = v1d + · · · + vn
d
recursively pick elements of B given A⊃ B
a nor b a∼ ∨b
the indices in A Dynamic function definition (dfn):
a nand b a∼ ∧b
a∈b? a∈b Decode single digits of B with respect A⊥B α is the left argument, ω is the right argument.
find a in b (binary index) a∈b? to base A f ← { ( +/ω*α ) * (÷α) }
bitwise a or b a >∨ b Encode B with respect to bases given A>B
bitwise a and b a >∧ b by A Traditional function definition (tradfn):
bitwise a nor b a >∼∨b
line label A A:
F: begin/end defun. “FR ← A f B ;U ;V” is “f takes left arg
bitwise a nand b a >∼∧b A, right arg B, has local vars U, V, and returns result in R”.
bitwise a 6= b a > 6= b branch to line A →A
bitwise a = b a >= b
Fres ← d f v ;sq ;sum
execute APL expression A ⊥A
◦ sq ← v * d
a!  !a format A as chars >A

b
sum ← +/sq
a!b
a user input ~ res ← sum*(÷d)
aπ ◦
∗a F
circle (trig) function a◦∗b system var/function ~
random integer in [1,a] ?a
a distinct random integers in [1,b] a?b reduce op over array A op/A
compress: select B using A as mask A/B Copyright c 2020 Jeronimo Pellegrini, Lucas S. Vieira

makes a vector out of A ,A A/B on last dimension A−B


/ designed by Jeronimo Pellegrini, Lucas S. Vieira and Stephen Gildea,
for GNU APL
append B to A A,B expand: insert zeros in B using A as A\B
mask Released under the terms of the GNU General Public License version 3
number of components in each dimen- ρA A\B on last dimension A−B
\ or later. For more APL documentation, check the GNU APL site. For
sion of A inner product with functions f, g Af.gB the TEX source for this card, see:
array with shape A and data elements Aρ B
B outer product with function f A◦.fB https://www.github.com/jpellegrini/gnu-apl-refcard
inverse matrix of A ~A
÷ for each b∈B, apply: Ab A¨B

You might also like