At the moment, the following sections describe only those language features that are New or Enhanced relative to the Extended APL Standard, or that deserve special comment.
Syntax
- Strand Assignment: (A1 A2 ... An)←R
- Modify Assignment: Af←R
- Modify Strand Assignment: (A1 A2 ... An)f←R
- Function/Operator Assignment: A←f, A←op1, A←op2
- Sink: ←R
- Point Notation:
- Base — 16b10FFFF is a shorthand for 16⊥1 0 15 15 15 15 and 10b45v is a shorthand for 10⊥4 5 31
- Euler — 2x3 is a shorthand for 2e3 or 2×(*1)*3 where e is Euler's Number (2.718281828459045...)
- Pi — 2p3 is a shorthand for 2π3 or 2×(○1)*3 where π is Archimedes' constant (3.141592653589793...)
- Gamma — 2g3 is a shorthand for 2γ3 where γ is Euler-Mascheroni's Constant (0.5772156649015329...)
- Hypercomplex — 2J3, 2i3 (both equal to 2+3×√¯1), 2ad3 (Angle in Degrees), 2ar3 (Angle in Radians), or 2au3 (Angle in Unit Normalized) for a Complex number, 1i2j3k4 for a Quaternion number, and 1i2j3k4l5ij6jk7kl8 for an Octonion number.
- Rational — 2r3 is a shorthand for 2÷3 as a Multiple-Precision Integer/Rational number.
- Variable-Precision Floating — 2.3v is a shorthand for 2.3 as a Multiple-Precision Floating Point number.
- Trains: e.g., avg←(+⌿ ÷ ≢) applies the functions to its argument(s) in a particular way (in this case, to compute the average of a numeric scalar or vector).
- Anonymous Functions/Operators: multi-line grouping of one or more statements all enclosed in braces such as {(+⌿⍵)÷≢⍵}.
Primitive functions
Name |
Symbol/Syntax |
Function Valence
|
Array Lookup |
L⍸R |
dyadic
|
Condense |
<[X] R |
monadic
|
Dilate |
>[X] R |
monadic
|
Expand |
L\[X] R |
dyadic
|
Find |
L⍷R |
dyadic
|
Index Generator |
⍳R |
monadic
|
Index Of |
L⍳R |
dyadic
|
Indexing |
R[L], R[L]←A, R[L]f←A, L⌷[X] R, L⍉R, L⊃R |
dyadic
|
Indices |
⍸R |
monadic
|
Matrix Inverse/Divide |
⌹R, L⌹R |
ambivalent
|
Mismatch |
L≢R |
dyadic
|
Partitioned Enclose |
L⊂[X] R |
dyadic
|
Primes |
πR, LπR |
ambivalent
|
Reshape |
L⍴R |
dyadic
|
Root |
√R, L√[X] R |
ambivalent
|
Sequence |
L..R |
dyadic
|
Sets |
L§R, L⊆R, L⊇R |
dyadic
|
Tally |
≢R |
monadic
|
Without |
L~R |
dyadic
|
where L is the Left argument, R is the Right argument, and [X] is an optional Axis value.
Primitive operators
where {L} is an optional Left argument, R is the Right argument, f and g represent Functions, a and b represent Variables, and [X] is an optional Axis value.
Datatypes
System Commands
System Commands provide features to the user of the APL system, separate from actual workspaces, variables or APL operators. These provide such features as accessing files, saving a workspace, and exiting the APL interpreter. The commands are not case sensitive, so )IN and )in do the same thing.
NARS2000 currently has the following system commands:
)BOX
|
|
Turn ON/OFF box around output
|
)CLEAR
|
|
Start a new session manager window with an empty workspace
|
)CLOSE
|
)COPY
|
)DROP
|
)EDIT
|
|
Create a new function in the workspace or edit an existing function
|
)ERASE
|
|
Delete a variable or function in the current workspace
|
)EXIT
|
|
Close down the interpreter and exit the program. Same as )OFF
|
)FNS
|
)FOP
|
|
Display functions, operators, and hyperators. Same as )FOPS
|
)FOPS
|
)HYP
|
|
Display hyperators only
|
)IN
|
)INASCII
|
|
|
)LIB
|
)LAOD
|
|
Alternative spelling of )LOAD
|
)LOAD
|
|
Load an existing workspace
|
)NEWTAB
|
|
|
System Variables and Functions