Glyph reference
Each glyph has a name, which links to its definitions and examples. A function glyph also has a name for its monad, which takes one argument, and for its dyad, which takes two. Operators take functions or arrays and derive functions. Notes flag unusual differences from Dyalog APL. Each function’s page gives its ranks. Given an argument of higher rank, the function is applied to each cell of that rank, as Rank does.
Typing glyphs
The keyboard map shows the Option and Option-Shift bindings, with dead keys outlined in orange.
Hold Alt, which is Option on a Mac, and press the key in the Key column. The keys are for a US keyboard layout. ≤ is Alt-< and ≥ is Alt->, each with Shift held. When the column shows a second key, press it with or without Alt held. For example, Alt-o c means Alt-o, then c. You can type a shifted second key without Shift. For example, Alt-q ; types ⍠, the same as Alt-q :. When an Alt key takes a second key, press Space or an unlisted key instead to type the Alt key’s glyph. For example, Alt-o then Space gives ○. Backspace or Escape cancels the sequence.
Superscripts start with Alt-6. Type Alt-6, -, then Space for bare inverse ⁻; Alt-6 then -1 gives signed ⁻¹. The second key is a digit, - then a digit, t for ᵀ, u for ᵘ, s for ˢ, or b for ᵇ. Subscripts start with Alt-5. The second key is a digit, - then a digit, or x, j, e or r for the number suffixes ₓ, ⱼ, ₑ and ᵣ. A glyph with no entry in the Key column, such as +, is on an ordinary ASCII key. The arrow glyphs ←, ↓, ↑ and ↦ are on Alt-h, Alt-j, Alt-k and Alt-l. Alt-[ types nothing, because terminals send it as the start of a control sequence. Type ∆ with Alt-7, and ⍙ with Alt-Minus then 7.
In the REPL, type a backtick followed by one of the names in these tables, then press Tab to enter the glyph, as named entry describes. In Python, each function’s name has _ in place of - and a trailing _ on Python keywords, as in index_of and and_. Each operator is a property of a function, under the operator’s name, as in f.reduce.
Functions
| Glyph | Key | Monad | Dyad | Note |
|---|---|---|---|---|
+ plus |
conjugate | add | Character offsets as BQN | |
- minus |
negate | subtract | Character difference as BQN | |
× times |
Alt-m | sign | multiply | |
÷ obelus |
Alt-u | reciprocal | divide | Exact rationals as J |
⌊ downstile |
Alt-d | floor | minimum | ⌊/⍬ is ∞ |
⌈ upstile |
Alt-s | ceiling | maximum | ⌈/⍬ is ¯∞ |
\| stile |
magnitude | residue | ||
* star |
exponential | exponent | ||
⊛ circle-star |
Alt-o 8 | natural-log | logarithm | |
○ circle |
Alt-o | cis | circular | Pi-times is π. Codes 0 to 8, inverted by k○⁻ |
π pi |
Alt-p | pi-times | pi-ratio | |
√ radical |
Alt-3 | sqrt | root | As BQN’s √ |
! exclamation |
factorial | binomial | ||
⍭ stile-tilde |
Alt-Backslash | prime | prime-mode | Like J’s p:, with different codes |
⨸ circle-divide |
Alt-o u | factors | factor-spec | As J’s q: |
⌻ quad-jot |
Alt-q t | roots | polyval | As J’s p., but coefficients come from ⌻⁻ |
¿ inverted-question |
Alt-/ | roll | deal | Dyalog’s ? |
∨ vee |
Alt-9 | real-imag | or | Monad as J’s +. |
∧ wedge |
Alt-0 | polar | and | Monad as J’s *. |
⊼ wedge-bar |
Alt-Minus 0 | square | nand | Dyad as Dyalog’s ⍲. Monad as J’s *: |
⊽ vee-bar |
Alt-Minus 9 | double | nor | Dyad as Dyalog’s ⍱. Monad as J’s +: |
~ tilde |
not | without | Major cells, as BQN | |
= equals |
classify | equal | Monad as J | |
≠ not-equals |
Alt-Shift-= | unique-mask | not-equal | |
< less-than |
sort-up | less | Monad sorts major cells | |
≤ less-than-or-equal |
Alt-< | decrement | less-equal | Monad as J’s <: |
> greater-than |
sort-down | greater | Monad sorts major cells | |
≥ greater-than-or-equal |
Alt-> | increment | greater-equal | Monad as J’s >: |
≡ equal-underbar |
Alt-= | depth | match | Unsigned depth, as APL2/BQN |
≢ equal-underbar-slash |
Alt-? | tally | not-match | |
ρ rho |
Alt-r | shape | reshape | Rank-0 reshape encloses |
, comma |
ravel | catenate | ||
⍪ comma-bar |
Alt-Minus , | table | catenate-first | |
⌽ circle-stile |
Alt-2 | reverse | rotate | |
⍉ circle-backslash |
Alt-o Backslash | transpose | reorder-axes | |
↑ up-arrow |
Alt-k | first | take | Monad takes first major cell |
↓ down-arrow |
Alt-j | split | drop | |
↕ up-down-arrow |
Alt-K | pairs | windows | Monad is 2↕; dyad as BQN’s ↕, plus movement/padding |
⊂ left-shoe |
Alt-z | enclose | partitioned-enclose | Encloses atoms; partitions first axis |
⊆ left-shoe-underbar |
Alt-Minus z | nest | partition | Partitions first axis |
⊃ right-shoe |
Alt-x | mix | pick | Monad as Dyalog ⎕ML≥2; pick cells or keys |
⌷ squad |
Alt-q Backslash | materialise | index | Negative indices; : keeps one axis, ∞ the rest; ¯∞ inserts one |
ι iota |
Alt-i | indices | index-of | Axis selectors; negative lengths count down |
↦ right-arrow-from-bar |
Alt-l | range | to | Counts up or down from 1, ¯1 or X to Y; not Dyalog’s branch |
: colon |
unkey | keyed | Axis keys | |
⍸ iota-underbar |
Alt-Minus i | where | interval-index | Dyad as BQN’s ⍋ |
∊ epsilon |
Alt-e | enlist | member | Major cells, as BQN |
∪ down-shoe |
Alt-v | unique | union | Major cells, as BQN |
∩ up-shoe |
Alt-c | duplicates | intersection | Major cells, as BQN |
⍷ epsilon-underbar |
Alt-Minus e | groups | find | Monad as Dyalog’s {⊂⍵}⌸ |
⍋ delta-stile |
Alt-Backslash 7 | grade-up | grade-up-by | |
⍒ del-stile |
Alt-Backslash g | grade-down | grade-down-by | |
# hash |
runs | replicate | Dyad as Dyalog’s ⌿; monad run-length encodes, and #⁻ decodes |
|
⊤ down-tack |
Alt-n | binary-encode | encode | Digits on last axis, as J |
⊥ up-tack |
Alt-b | binary-decode | decode | Digits on last axis, as J |
⌹ domino |
Alt-q u | matrix-inverse | matrix-divide | |
⊣ left-tack |
Alt-; | same-left | left | |
⊢ right-tack |
Alt-’ | same | right | |
⍎ hydrant |
Alt-o b | execute | execute-in | X has keys on its first axis, whereas Dyalog takes a namespace |
⍕ thorn |
Alt-o n | format | format-spec |
Monadic operators
A monadic operator takes one operand, on its left, as in +/. The Monad and Dyad columns give the names of the derived function’s monadic and dyadic forms. When both forms do the same thing, one name in the Monad column covers them. In the notes, f and g are functions, and a, n and r are arrays or numbers.
| Glyph | Key | Monad | Dyad | Note |
|---|---|---|---|---|
/ slash |
reduce | f/, along the last axis. A left argument is a seed, as BQN’s ´ |
||
⌿ slash-bar |
Alt-Minus / | reduce-first | f⌿, along the first axis. Seed as / |
|
\\ backslash |
scan | f\, along the last axis. A left argument is a seed. Accumulates LTR as BQN |
||
⍀ backslash-bar |
Alt-Minus Backslash | scan-first | f⍀, along the first axis. Seed as \\. Accumulates LTR as BQN |
|
¨ diaeresis |
Alt-1 | each | f¨ |
|
ᵇ superscript-b |
Alt-6 b | bitwise | fᵇ applies a Boolean function to integer bits |
|
ᵘ superscript-u |
Alt-6 u | unary | X fᵘ Y is f Y |
|
⁻ superscript-minus |
Alt-_ | inverse | f⁻ undoes f. A superscript digit immediately after the minus instead makes a negative Rank |
|
⍨ tilde-diaeresis |
Alt-1 Backtick | self | commute | f⍨. a⍨ is a constant function |
⊗ circle-times |
Alt-o m | outer-product | g⊗, as BQN’s ⌜ |
|
⌸ quad-equal |
Alt-q = | key | f⌸ |
|
⇄ right-left-arrows |
Alt-4 | optimize | f⇄ searches for the point where f is least, or with "solve":$t, where its residuals are zero. A left argument holds options |
|
∂ partial |
Alt-f | derivative | f∂ gives the Jacobian. The dyad differentiates α f ω with respect to ω |
Dyadic operators
A dyadic operator takes an operand on each side, as in f⍤1. The columns are as for monadic operators.
| Glyph | Key | Monad | Dyad | Note |
|---|---|---|---|---|
↣ right-tail-arrow |
Alt-. | before | f↣g. a↣f binds a left argument. As BQN’s ⊸ |
|
↢ left-tail-arrow |
Alt-, | after | f↢g. f↢a binds a right argument. As BQN’s ⟜ |
|
⍤ jot-diaeresis |
Alt-1 t | rank | f⍤r, f⍤g. Rank 0 preserves atom/scalar distinction |
|
∘ jot |
Alt-t | atop | f∘g, as BQN’s ∘ |
|
⍠ quad-colon |
Alt-q ; | axis | f⍠A, f⍠g apply f along named or numbered axes |
|
⍥ circle-diaeresis |
Alt-1 o | over | f⍥g |
|
. dot |
determinant | inner-product | f.g. The monad is J’s determinant form, u .v. Also array fields and indexing |
|
⍣ star-diaeresis |
Alt-1 8 | power | f⍣n iterates or inverts, f⍣g computes counts once, f⍣∞ finds a fixed point; f⍣gˢ stops at g, f⍣[g] keeps every state until g. List counts give history, as J/BQN |
|
⊘ circle-slash |
Alt-o / | valences | f⊘g calls f with one argument and g with two, as BQN’s ⊘ |
|
⍚ diamond-underbar |
Alt-Minus Backtick | agenda | selector⍚cases calls the function that the selector picks, as BQN’s ◶, or one for each cell |
|
@ at |
under | f@g, f@a, f@[p] apply f under a selection, positions, mask or transform. As BQN’s ⌾, not Dyalog’s @ |
||
⌺ quad-diamond |
Alt-q Backtick | stencil | f⌺a, f⌺g |
Syntax and literals
| Glyph | Key | Name | Note |
|---|---|---|---|
← left-arrow |
Alt-h | assign | Includes modified and selective assignment |
(…) parentheses |
Grouping. With ◇, a vector of rows: (4◇4 5) is [[4] [4 5]] |
||
[…] brackets |
Vectors and arrays: [a b c], [a;b c], [1 2◇3 4]. One item makes a one-item vector: [x] is ,⊂x |
||
{…} braces |
Defined function or operator. ; separates its bodies |
||
α alpha, ω omega |
Alt-a, Alt-w | left-argument, right-argument | |
⍶ alpha-underbar, ⍹ omega-underbar |
Alt-Minus a, Alt-Minus w | left-operand, right-operand | |
∇ del, ⍢ del-diaeresis |
Alt-g, Alt-1 g | recursion, operator-recursion | A dfn’s own function or operator |
? question |
predicate | Inside dfns | |
:: error-guard |
Error guard inside dfns | ||
◇ diamond |
Alt-Backtick | separator | Separates statements, rows inside brackets, and rows of a vector inside parentheses |
⁝ tricolon |
Alt-: | token-separator | Separates tokens without ending the run or continuing a literal strand |
⍝ lamp |
Alt-o c | comment | |
⎕← quad |
Alt-q | io | Explicit output. Read alone, the next line of input |
• bullet |
Alt-y | system | System function prefix |
⍬ zilde |
Alt-Shift-0 | empty | Empty numeric vector |
'…' "…" quote |
Character and string literals | ||
¯ overbar |
Alt-Minus | negative | Negative literal sign |
∞ infinity |
Alt-8 | Real infinity | |
$t $f $n constants |
True, false and NaN | ||
$e caught error |
The error that an error guard’s handler caught | ||
² ⁻ ᵀ ˢ superscript |
Alt-6 | x² is x*2; on a function, f¹ is f⍤1, f⁰ ¹ is f⍤[0 1], and f⁻¹ is rank ¯1. Bare f⁻ is inverse; mᵀ is ⍉m; fˢ is a scalar holding f |
|
₁ ₋₁ subscript |
Alt-5 | Array positions: v₁ is 1⌷v, v₋₁ is the last major cell, m₁ ₂ is m.[1 2], and v₁←5 assigns to that cell. Function axes: +/₀ is +/⍠0, and +/₁ ₂ is +/⍠[1 2] |
Numbers covers numeric notation, such as ₓ, r, j and e.
System names
System names start with •. System functions lists them.
Language-wide differences from Dyalog APL
- Vectors: a bracket list such as
[a b c]is a vector. A strand of literals, such as1 2 3, needs no brackets.[5]is a one-item vector, the same as,5. Parentheses group:(5)is5. A scalar holding5is⊂5. Arrays side by side also form a vector:a bis[a b].(1 2◇3)is the vector of rows[[1 2] [3]]. - Runs: outside brackets, spaces group an expression into runs, and each run acts as one token. A run that ends in a function is a train:
+/÷≢is the mean, and2×is2↣×. An operator takes the token next to it, so after a run that ends in a dyadic operator, the next run is its right operand: in⌊@ 10× x, the right operand of@is10×. - Indexing: brackets are used to write vectors, never to index. Positions and axes count from 0, and negative positions and axes count from the end. Index
⌷selects items:0⌷vis the first item ofv. - Atoms: numbers, characters and functions are atoms, distinct from scalars, as in BQN. Enclosing always adds a layer:
⊂3 ≡ 3is$f. - Numbers: bare numbers are approximate.
ₓmarks an exact integer, androrᵣan exact rational, as in J:1ᵣ÷3ᵣis1ᵣ3, while1ₓ÷3ₓfloors to0ₓ. Predicates, positions, tally and shape are exact. See Mathish mode for comparison and zero-division conventions. - Agreement: pervasive functions, Each and Rank align leading axes. An axis of length 1 expands to match:
2 3ρι6 + 10 20is[10 11 12◇23 24 25]. - Major cells:
∊ ~ ∪ ∩compare major cells,N#Yreplicates them,N⊂YandN⊆Ysplit along the first axis.⊤and⊥put digits on the last axis, as in J. - Reverse and rotate:
⌽₀selects the first axis, replacing⊖; plain⌽selects the last. With Axis, a nonnegative axis that the data lacks adds trailing length-1 axes up to that axis:⌽₁treats shape[3]as[3 1]. - System names: written
•name, as in BQN, not⎕NAME. Most Dyalog system functions and variables are not included. - Axis keys label positions along an axis. In
K:Y,Kis an expression that gives the keys.T.ais"a"⊃T.T.(expr)evaluatesexpr, andT⍎YevaluatesY, with the keys ofTas names. - Dfns: BPL has dfns, with no tradfns and no colon control structures such as
:If. - Removed forms: Dyalog’s bracket axes
f[A], outer product∘.f, windowed reduce and laminate are not in BPL. Use numeric subscripts or⍠for axes,⊗for outer products,↕for windows, as in+/3↕v, and[x◇y]for rows./ ⌿ \ ⍀are only reduce and scan. A left argument to them is a seed, as in BQN:2+/1 2 3is8. Replicate and expand are#and#⁻.