Language Features: Difference between revisions
From NARS2000
Jump to navigationJump to search
Line 27: | Line 27: | ||
==Primitive operators== | ==Primitive operators== | ||
* [[Axis]]: <apll><i>f</i>[<i>X</i>]</apll>, <apll><i>f op1</i>[<i>X</i>]</apll>, <apll><i>f op2</i>[<i>X</i>]g</apll> | * [[Axis]]: <apll><i>f</i>[<i>X</i>]</apll>, <apll><i>f op1</i>[<i>X</i>]</apll>, <apll><i>f op2</i>[<i>X</i>]g</apll> | ||
* [[ | * [[Composition]]: <apll><i>f</i>⍥<i>g</i></apll> | ||
* [[ | * [[Compose]]: <apll><i>f</i>∘<i>g</i></apll>, <apll><i>f</i>∘R</apll>, <apll>L∘<i>g</i></apll> | ||
* [[Null]]: <apll><i>f</i>⊙</apll> | * [[Null]]: <apll><i>f</i>⊙</apll> | ||
* [[Rank]]: <apll><i>f</i>⍤[<i>X</i>] Y</apll> | * [[Rank]]: <apll><i>f</i>⍤[<i>X</i>] Y</apll> |
Revision as of 15:02, 2 February 2011
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
- Reshape: 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
- Null: f⊙
- Rank: f⍤[X] Y
Datatypes
- Infinity: ∞ and ¯∞
- Arithmetic Progression Arrays: 2 3 4⍴⍳24
- Unicode Characters
- Array Predicates
System Functions
- ⎕A (Uppercase English Alphabet)
- ⎕AT (Object Attributes)
- ⎕AV (Atomic Vector)
- ⎕CR (Canonical Representation)
- ⎕DM (Diagnostic Message)
- ⎕DR (Data Representation)
- ⎕EA (Execute Alternate)
- ⎕EC (Execute Controlled)
- ⎕EM (Event Message)
- ⎕ERROR (Signal Error)
- ⎕ES (Event Simulate)
- ⎕ET (Event Type)
- ⎕FMT (Format)
- ⎕MF (Monitor Function)
- ⎕NC (Name Class)
- ⎕NL (Name List)
- ⎕SYSID (System Identifier)
- ⎕SYSVER (System Version)
- ⎕TC/⎕TCxxx (Terminal Control)
- ⎕TF (Transfer Form)
- ⎕UCS (Universal Character Set)
- ⎕VR (Visual Representation)
- ⎕WA (Workspace Available)
System Variables
- Scalar System Variables (⎕CT, ⎕IO, ⎕PP, ⎕PW, ⎕RL)
- ⎕ELX (Error Trapping)
- ⎕FC (Format Control)
- ⎕IC (Indeterminate Control)