Language Features: Difference between revisions
From NARS2000
Jump to navigationJump to search
Line 13: | Line 13: | ||
==Primitive functions== | ==Primitive functions== | ||
* [[Array Lookup]]: <apll>L⍸R</apll> | |||
* [[Find]]: <apll>L⍷R</apll> | * [[Find]]: <apll>L⍷R</apll> | ||
* [[Index Generator]]: <apll>⍳R</apll> | * [[Index Generator]]: <apll>⍳R</apll> | ||
Line 18: | Line 19: | ||
* [[Indexing]]: <apll>R[L]</apll>, <apll>R[L]←A</apll>, <apll>R[L]<i>f</i>←A</apll>, <apll>L⌷R</apll>, <apll>L⍉R</apll>, <apll>L⊃R</apll> | * [[Indexing]]: <apll>R[L]</apll>, <apll>R[L]←A</apll>, <apll>R[L]<i>f</i>←A</apll>, <apll>L⌷R</apll>, <apll>L⍉R</apll>, <apll>L⊃R</apll> | ||
* [[Indices]]: <apll>⍸R</apll> | * [[Indices]]: <apll>⍸R</apll> | ||
* [[Matrix Inverse/Divide]]: <apll>⌹R</apll>, <apll>L⌹R</apll> | * [[Matrix Inverse/Divide]]: <apll>⌹R</apll>, <apll>L⌹R</apll> | ||
* [[Mismatch]]: <apll>L≢R</apll> | * [[Mismatch]]: <apll>L≢R</apll> |
Revision as of 23:47, 25 May 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 scalar or vector).
- System Labels: ⎕PRO and ⎕ID in user-defined functions/operators.
Primitive functions
- Array Lookup: L⍸R
- 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
- Variant: f⍠V
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: 1.234v 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
Niladic System Functions | |
---|---|
⎕A | The alphabet from A to Z, also Á to Ź,  to Ẑ, À to À, Ä to Z and à to Z, all in lowercase, too using the variations ⎕a ⎕A ⎕á ⎕Á ⎕à ⎕À ⎕â ⎕ ⎕ä ⎕Ä ⎕ã ⎕à |
⎕AV | Atomic Vector |
⎕CS | Collating sequence |
⎕EM | Event Message |
⎕ET | Event Type |
⎕LC | Line Counter |
⎕NNAMES | Names of Open Native Files |
⎕NNUMS | Tie Numbers of Open Native Files |
⎕SI | State Indicator |
⎕SYSID | System Identifier |
⎕SYSVER | System Version |
⎕T | Tickcount |
⎕TC | Terminal Control Characters |
⎕TCBEL | Terminal Control Character, Bell |
⎕TCBS | Terminal Control Character, Backspace |
⎕TCESC | Terminal Control Character, Escape |
⎕TCFF | Terminal Control Character, Form Feed |
⎕TCHT | Terminal Control Character, Horizontal Tab |
⎕TCLF | Terminal Control Character, Line Feed |
⎕TCNL | Terminal Control Character, New Line |
⎕TCNUL | Terminal Control Character, Null |
⎕TS | Time Stamp |
⎕WA | Workspace Available |
Monadic or dyadic system functions | |
⎕AT | Attributes |
⎕CR | Canonical representation |
⎕DC | Data Conversion |
⎕DFT | Discrete Fourier Transform |
⎕DL | Delay or pause APL processing |
⎕DR | Data representation |
⎕EA | Execute alternate |
⎕EC | Execute controlled |
⎕ERROR | Signal error |
⎕ES | Event simulate |
⎕EX | Expunge names |
⎕FMT | Format |
⎕FX | Function fix |
⎕MF | Monitor function |
⎕NAPPEND | Append data to an open native file |
⎕NC | Name classification |
⎕NCREATE | Create and open a native file |
⎕NERASE | Erase an open native file |
⎕NINFO | Native file information |
⎕NL | Name list |
⎕NREAD | Read data from an open native file |
⎕NRENAME | Rename an open native file |
⎕NREPLACE | Replace data in an open native file |
⎕NRESIZE | Resize an open native file |
⎕NSIZE | Get the size of an open native file |
⎕NTIE | Open a native file |
⎕NUNTIE | Close a native file |
⎕STOP | Stop execution of a user-defined function/operator/hyperator or Magic Function |
⎕TF | Transfer form |
⎕TRACE | Trace execution of a user-defined function/operator/hyperator or Magic Function |
⎕UCS | Universal character set |
⎕VR | Vector representation of a function |