Language Features: Difference between revisions
From NARS2000
Jump to navigationJump to search
Line 48: | Line 48: | ||
==System Functions== | ==System Functions== | ||
<table border=1> | |||
<td> | |||
{| | |||
|- | |||
|| [[System Function A|<apll>⎕A</apll>]] | |||
|| (Uppercase English Alphabet) | |||
|- | |||
|| [[System Function AT|<apll>⎕AT</apll>]] | |||
|| (Object Attributes) | |||
|- | |||
|| [[System Function AV|<apll>⎕AV</apll>]] | |||
|| (Atomic Vector) | |||
|- | |||
|| [[System Function CR|<apll>⎕CR</apll>]] | |||
|| (Canonical Representation) | |||
|- | |||
|| [[System Function DM|<apll>⎕DM</apll>]] | |||
|| (Diagnostic Message) | |||
|- | |||
|| [[System Function DR|<apll>⎕DR</apll>]] | |||
|| (Data Representation) | |||
|- | |||
|| [[System Function EA|<apll>⎕EA</apll>]] | |||
|| (Execute Alternate) | |||
|- | |||
|| [[System Function EC|<apll>⎕EC</apll>]] | |||
|| (Execute Controlled) | |||
|- | |||
|| [[System Function EM|<apll>⎕EM</apll>]] | |||
|| (Event Message) | |||
|} | |||
</td> | |||
<td> | |||
{| | |||
|| [[System Function ERROR|<apll>⎕ERROR</apll>]] | |||
|| (Signal Error) | |||
|- | |||
|| [[System Function ES|<apll>⎕ES</apll>]] | |||
|| (Event Simulate) | |||
|- | |||
|| [[System Function ET|<apll>⎕ET</apll>]] | |||
|| (Event Type) | |||
|- | |||
|| [[System Function FMT|<apll>⎕FMT</apll>]] | |||
|| (Format) | |||
|- | |||
|| [[System Function MF|<apll>⎕MF</apll>]] | |||
|| (Monitor Function) | |||
|- | |||
|| [[System Function Native Files|<apll>⎕N</apll>xxx]] | |||
|| (Native File Functions) | |||
|- | |||
|| [[System Function NC|<apll>⎕NC</apll>]] | |||
|| (Name Class) | |||
|- | |||
|| [[System Function NL|<apll>⎕NL</apll>]] | |||
|| (Name List) | |||
|} | |||
</td> | |||
<td> | |||
{| | |||
|| [[System Function SYSID|<apll>⎕SYSID</apll>]] | |||
|| (System Identifier) | |||
|- | |||
|| [[System Function SYSVER|<apll>⎕SYSVER</apll>]] | |||
|| (System Version) | |||
|- | |||
|| [[System Function TC|<apll>⎕TC</apll>/<apll>⎕TC</apll>xxx]] | |||
|| (Terminal Control) | |||
|- | |||
|| [[System Function TF|<apll>⎕TF</apll>]] | |||
|| (Transfer Form) | |||
|- | |||
|| [[System Function UCS|<apll>⎕UCS</apll>]] | |||
|| (Universal Character Set) | |||
|- | |||
|| [[System Function VR|<apll>⎕VR</apll>]] | |||
|| (Visual Representation) | |||
|- | |||
|| [[System Function WA|<apll>⎕WA</apll>]] | |||
|| (Workspace Available) | |||
|} | |||
</td> | |||
</table> | |||
==System Variables== | ==System Variables== |
Revision as of 22:30, 21 February 2013
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 as a shorthand for 16⊥1 0 15 15 15 15
- Pi — 2p3 as a shorthand for 2π3 or 2×(○1)*3
- Euler — 2x3 as a shorthand for 2e3 or 2×(*1)*3.
- 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 vector).
- System Labels: ⎕PRO and ⎕ID in user-defined functions/operators.
Primitive functions
- Find: L⍷R
- Index Generator: ⍳R
- Index Of: L⍳R
- Indexing: R[L], R[L]←A, R[L]f←A, L⌷R, L⍉R, L⊃R
- Indices: ⍸R
- Matrix Inverse/Divide: ⌹R, L⌹R
- Mismatch: L≢R
- Partitioned Enclose: L⊂[X] R
- Primes: πR and LπR
- Reshape: L⍴R
- Root: √R and L√R
- Sequence: L..R
- Tally: >R
- Without: L~R
Primitive operators
- Axis: f[X], f op1[X], f op2[X]g
- Composition: f⍥g
- Compose: f∘g, f∘R, L∘g
- Multisets: f⍦
- Null: f⊙
- Rank: f⍤[X] Y
Datatypes
- Infinity: ∞ and ¯∞
- Arithmetic Progression Arrays: 2 3 4⍴⍳24
- Unicode Characters
- Array Predicates
- Rational Numbers: 1r3 and 12345x
- Variable-precision Floating Point (VFP) Numbers: 1v234 and 12v
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:
|
|
System Functions
|
|
|
System Variables
- Scalar System Variables (⎕CT, ⎕IO, ⎕FPC, ⎕PP, ⎕PW, ⎕RL)
- ⎕ELX (Error Trapping)
- ⎕FC (Format Control)
- ⎕FPC (Floating Point Control)
- ⎕IC (Indeterminate Control)