Glyph reference
Each name below links to its definitions and examples. Examples show an equivalent APL value after ⍝. A monad takes one argument; a dyad takes two. Operators take functions or arrays and derive functions. Notes give glyph-specific differences from Dyalog APL.
Functions
| Glyph | Monad | Dyad | Note |
|---|---|---|---|
+ Add |
Conjugate | Add | Character offsets as BQN: 'a'+3 is 'd' |
- Dash |
Negate | Subtract | Character difference as BQN: 'd'-'a' is 3x |
× Mul |
Direction | Multiply | |
÷ Div |
Reciprocal | Divide | Exact rationals as J: 1x÷3x is 1r3 |
⌊ Floor |
Floor | Minimum | ⌊/⍬ is ∞ |
⌈ Ceiling |
Ceiling | Maximum | ⌈/⍬ is ¯∞ |
\| Stile |
Magnitude | Residue | |
* Star |
Exponential | Exponent | |
⍟ Log |
Natural log | Logarithm | |
○ Circle |
Unit circle | Circular functions | Monad is *0j1×Y, a unit-circle point. Pi times is π |
π Pi |
Pi times | Pi fraction | Monad takes over Pi times from ○. XπY is Xπ÷Y |
√ Root |
Square root | Nth root | As BQN’s √, with complex results: √¯4 is 0j2 |
! Factorial |
Factorial | Binomial | |
ℙ Prime |
Nth prime (one-based) | Prime operations | As J’s p: with the same codes, but one-based |
⨸ Factor |
Prime factors | Exponents / factor table | As J’s q:, with ∞ and ¯∞ for J’s _ and __ |
⊛ Polynomial |
Roots / coefficients | Evaluate | As J’s p.: coefficients are constant-first |
? Question |
Roll | Deal | |
∨ Or |
Real / imaginary parts | OR / GCD | Monad as J’s +. |
∧ And |
Magnitude / angle | AND / LCM | Monad as J’s *. |
⍲ Nand |
Square | NAND | Monad as J’s *: |
⍱ Nor |
Double | NOR | Monad as J’s +: |
~ Tilde |
NOT | Without | |
= Equal |
Self-classify | Equal | Monad as J: one mask row per distinct major cell |
≠ Not equal |
Unique mask | Not equal | |
< Less |
— | Less | |
≤ Less or equal |
Decrement | Less or equal | Monad as J’s <: |
> Greater |
— | Greater | |
≥ Greater or equal |
Increment | Greater or equal | Monad as J’s >: |
≡ Match |
Depth | Match | |
≢ Tally |
Tally | Not match | |
⍴ Rho |
Shape | Reshape | ⍬⍴Y gives a rank-0 array: ⍬⍴1 2 is ⊂1 |
, Comma |
Ravel | Catenate | |
⍪ Table |
Table | Catenate first | |
⌽ Reverse |
Reverse last | Rotate last | |
⊖ Reverse first |
Reverse first | Rotate first | |
⍉ Transpose |
Transpose | Reorder / diagonal axes | |
↑ Take |
First | Take | Monad as Dyalog ⎕ML≥2, but takes a major cell: ↑2 3⍴⍳6 is 1 2 3 |
↓ Drop |
Split | Drop | |
↕ Windows |
— | Leading-axis windows | As BQN’s ↕, plus movements and padding (negative sizes) as in ⌺. Replaces windowed reduce: +/2↕1 2 3 4 is 3 5 7 |
⊂ Enclose |
Enclose | Partitioned enclose | Encloses atoms too, as BQN: (⊂3)≡3 is 0x |
⊆ Nest |
Nest | Partition | |
⊃ Mix |
Mix | Pick | Monad as Dyalog ⎕ML≥2. Pick takes cells: 2⊃2 3⍴⍳6 is 4 5 6. A string picks by key |
⌷ Squad |
Identity | Index | |
⍳ Iota |
Index generator | Index of | ⍳[axes]Y returns axis selectors |
⍸ Where |
Where | Interval index | |
∊ Member |
Enlist | Membership | |
∪ Union |
Unique | Union | |
∩ Intersection |
— | Intersection | |
⍷ Find |
— | Find | |
⍋ Grade up |
Grade up | Grade with collation | |
⍒ Grade down |
Grade down | Grade with collation | |
/ Slash |
— | Replicate last | |
⌿ Slash bar |
— | Replicate first | |
\ Backslash |
— | Expand last | |
⍀ Backslash bar |
— | Expand first | |
⊤ Encode |
Binary encode | Encode | Monad as J’s #:, but digits run along the first axis |
⊥ Decode |
Binary decode | Decode | Monad as J’s #., but digits run along the first axis |
⌹ Domino |
Matrix inverse | Matrix divide | |
⊣ Left |
Identity | Left | |
⊢ Right |
Identity | Right | |
⍎ Execute |
Execute | Keyed lookup: X⍎Y is Y⊃X |
Dyad runs no code. Dyalog executes Y in namespace X |
⍕ Format |
Format | Format by specification |
Operators
f, g are functions; a, n, r are arrays or numbers.
| Glyph | Form | Meaning | Note |
|---|---|---|---|
/ Slash |
f/ |
Reduce / seeded reduce last | Seed as BQN’s ´: 10 -/1 2 3 is ¯8. For windows use ↕ |
⌿ Slash bar |
f⌿ |
Reduce / seeded reduce first | Seed and windows as / |
\ Backslash |
f\ |
Scan / seeded scan last | Accumulates left to right as BQN’s Scan: -\1 2 3 is 1 ¯1 ¯4 |
⍀ Backslash bar |
f⍀ |
Scan / seeded scan first | Left to right as \ |
¨ Each |
f¨ |
Each | |
⍨ Commute |
f⍨, a⍨ |
Self / commute / constant | |
∘ Compose |
f∘g, a∘f, f∘a |
Compose / bind | |
⍤ Rank |
f⍤g, f⍤r |
Atop / rank | |
⍥ Over |
f⍥g |
Over | |
⍛ Behind |
f⍛g |
Behind | |
. Dot |
f.g |
Inner product | Outer product is g⌝. After an array, T.name is 'name'⊃T |
⌝ Outer product |
g⌝ |
Outer product | As BQN’s ⌜; ∘.g is a SYNTAX ERROR |
⌸ Key |
f⌸ |
Key | |
⍣ Power |
f⍣n, f⍣g, f⍣[p] |
Iterate / invert / repeat until; enclose count or predicate for history | Array counts as J’s ^:: (1∘+)⍣3 ¯2 0 3⊢10 is 13 8 10 13 |
⇄ Inverse pair |
f⇄g |
Attach an explicit inverse | As J’s :. |
⌾ Under |
f⌾g |
Transform, apply, inverse-transform | As J’s &. |
∂ Derivative |
f∂ |
Gradient / vector–Jacobian product | |
◶ Agenda |
selector◶cases |
Select and call one function | As BQN’s ◶, but one-based |
@ At |
f@a, a@g |
Functional amend | |
⌺ Stencil |
f⌺a |
Stencil |
Syntax and literals
| Form | Meaning |
|---|---|
˘ Strand |
Form a vector of values: 1˘+˘'abc' |
← Assign |
Assignment, including modified/indexed/selective forms |
→ Pipe |
Left-to-right function application |
(…) Parentheses |
Grouping / nested array literals / trains |
[…] Brackets |
Enclosure, array literals, indexing and axes |
; Semicolon |
Index-axis separator |
{…} Braces |
Defined function or operator |
⍺ Alpha, ⍵ Omega |
Left / right argument |
⍶ Alpha underbar, ⍹ Omega underbar |
Left / right operand |
∇ Del, ⍢ Del diaeresis |
Function / operator self-reference |
: Colon, :: Error guard |
Unkey / key axes; Boolean guard / error guard inside dfns |
⋄ Diamond |
Statement or literal separator |
⍝ Comment |
Comment |
⎕← Quad |
Explicit output |
• Bullet |
System name prefix |
⍬ Zilde |
Empty numeric vector |
'…' Quote |
Character literal |
¯ Overbar |
Negative literal sign |
∞ Infinity |
Real infinity |
Numeric notation x, r, j, E: see numbers.
System names
Names are case-insensitive. •a and •d are constant arrays; the other names are functions, usable with operators and composition.
| Name | Meaning |
|---|---|
•a Alphabet |
Uppercase Latin alphabet |
•d Digits |
Decimal digits |
•c Case |
Unicode case conversion |
•csv CSV |
CSV text → keyed column vectors |
•tocsv CSV |
Keyed column vectors → CSV text |
•r Regex |
Compiled search, captures and replacement |
•normal, •binomial, … Distributions |
Sampling, density, CDF and quantiles; 17 families |
•json JSON |
JSON text → arrays and keyed vectors |
•tojson JSON |
Arrays and keyed vectors → JSON text |
•vfi Numeric input |
Parse numeric fields with a validity mask |
•nget Read |
Read UTF-8 text or bytes |
•nput Write |
Write UTF-8 text or bytes |
•element, •xml, •svg XML and SVG |
Build, serialize and display element trees |
•mime Rich display |
The MIME bundle that display uses |
•plot Plots |
Charts from vectors, matrices and tables |
•ucs Unicode |
Unicode code points / encodings |
•load Load |
Evaluate an APL source file |
•signal Signal |
Raise an ordinary APL error |
•nc Name class |
Classify visible names |
•nl Name list |
List names by class and prefix |
•src Source |
Function/operator source |
•ex Expunge |
Erase bindings |
Index origin: 1. Comparison tolerance: 1E¯14.
Language-wide differences from Dyalog APL
- Atoms: numbers, characters and functions are atoms, distinct from scalars, as BQN. Enclosing always adds a layer:
(⊂3)≡3is0x. - Numbers: bare numbers are approximate.
xandrmark exact integers and rationals, as J:1x÷3xis1r3. Predicates, positions, tally and shape are exact. - Agreement: scalar functions, Each and Rank align leading axes, and unit dimensions expand:
(2 3⍴⍳6)+10 20is[11 12 13 ⋄ 24 25 26]. - System names: written
•name, as BQN, not⎕NAME. Most Dyalog system functions and variables are not included. - Axis keys name data.
K:Yevaluates its keys.T.ais'a'⊃T, andX⍎YisY⊃X.