Language Features: Difference between revisions

From NARS2000
Jump to navigationJump to search
 
(49 intermediate revisions by the same user not shown)
Line 2: Line 2:


==Syntax==
==Syntax==
* [[Strand Assignment]]:  <apll>(A<sub>1</sub> A<sub>2</sub> ... A<sub>n</sub>)←R</apll>
* [[Strand Assignment]]:  <apll>(A1 A2 ... An)←R</apll>
* [[Modify Assignment]]:  <apll>A<i>f</i>←R</apll>
* [[Modified Assignment]]:  <apll>Af←R</apll>
* [[Modify Strand Assignment]]:  <apll>(A<sub>1</sub> A<sub>2</sub> ... A<sub>n</sub>)<i>f</i>←R</apll>
* [[Modify Strand Assignment]]:  <apll>(A1 A2 ... An)f←R</apll>
* [[Function/Operator Assignment]]:  <apll>A←<i>f</i></apll>, &nbsp;&nbsp;<apll>A←<i>op1</i></apll>, &nbsp;&nbsp;<apll>A←<i>op2</i></apll>
* [[Hyperators]]:  <apll>∇ Z←L (LO (LH dhdo RH) RO) R</apll>
<!-- * [[Selective Assignment]]:  e.g., <apll>(1 1⍉M)←0</apll> -->
* [[Function/Operator/Hyperator Assignment]]:  <apll>A←f</apll>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<apll>A←op1</apll>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<apll>A←op2</apll>
* [[Binding Strength]]:  How Variables, Functions, Operators, Hyperators and other syntactic elements combine
* [[Sink]]:  <apll>←R</apll>
* [[Sink]]:  <apll>←R</apll>
* [[Point Notation]]:   
* [[Point Notation]]:   
** '''Base''' &mdash; <apll>16<pn>b</pn>10FFFF</apll> is a shorthand for <apll>16⊥1 0 15 15 15 15</apll> and <apll>10<pn>b</pn>45v</apll> is a shorthand for <apll>10⊥4 5 31</apll>
** '''Base''' <apll>16<_b/>10FFFF</apll> is a shorthand for <apll>16⊥1 0 15 15 15 15</apll> and <apll>10<_b/>45v</apll> is a shorthand for <apll>10⊥4 5 31</apll>.
** '''Euler''' &mdash; <apll>2<pn>x</pn>3</apll> is a shorthand for <apll>2e<sup>3</sup></apll> or <apll>2×(*1)*3</apll> where <apll>e</apll> is [https://en.wikipedia.org/wiki/E_(mathematical_constant) Euler's Number] (2.718281828459045...)
** '''Euler''' <apll>2<_x/>3</apll> is a shorthand for 2∙e<sup>3</sup> or <apll>2×(*1)*3</apll> where e is [https://en.wikipedia.org/wiki/E_(mathematical_constant) Euler's Number] (<apll>2.718281828459045...</apll>).
** '''Pi''' &mdash; <apll>2<pn>p</pn>3</apll> is a shorthand for <apll>2&pi;<sup>3</sup></apll> or <apll>2×(○1)*3</apll> where <apll>&pi;</apll> is [https://en.wikipedia.org/wiki/Pi Archimedes' constant] (3.141592653589793...)
** '''Pi''' <apll>2<_pi/>3</apll> is a shorthand for 2∙π<sup>3</sup> or <apll>2×(○1)*3</apll> where π is [https://en.wikipedia.org/wiki/Pi Archimedes' constant] (<apll>3.141592653589793...</apll>).
** '''Gamma''' &mdash; <apll>2<pn>g</pn>3</apll> is a shorthand for <apll>2&gamma;<sup>3</sup></apll> where <apll>&gamma;</apll> is [https://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant Euler-Mascheroni's Constant] (0.5772156649015329...)
** '''Gamma''' <apll>2<_g/>3</apll> is a shorthand for 2∙γ<sup>3</sup> where γ is [https://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant Euler-Mascheroni's Constant] (<apll>0.5772156649015329...</apll>).
** '''Hypercomplex''' &mdash; <apll>2<hc>J</hc>3</apll>, <apll>2<hc>i</hc>3</apll> (both equal to <apll>2+3×√¯1</apll>), <apll>2<hc>ad</hc>3</apll> (Angle in Degrees), <apll>2<hc>ar</hc>3</apll> (Angle in Radians), or <apll>2<hc>au</hc>3</apll> (Angle in Unit Normalized) for a Complex number, <apll>1<hc>i</hc>2<hc>j</hc>3<hc>k</hc>4</apll> for a Quaternion number, and <apll>1<hc>i</hc>2<hc>j</hc>3<hc>k</hc>4<hc>l</hc>5<hc>ij</hc>6<hc>jk</hc>7<hc>kl</hc>8</apll> for an Octonion number.
** '''Zeta''' — <apll>2<_z/>3</apll> is a shorthand for 2∙&zeta;(3) where &zeta;(x) is the [https://en.wikipedia.org/wiki/Riemann_zeta_function Riemann Zeta function].
** '''Rational''' &mdash; <apll>2<pn>r</pn>3</apll> is a shorthand for <apll>2÷3</apll> as a Multiple-Precision Integer/Rational number.
** Complex:
** '''Variable-Precision Floating''' &mdash; <apll>2.3<pn>v</pn></apll> is a shorthand for <apll>2.3</apll> as a Multiple-Precision Floating Point number.
*** <apll>2<_i/>3</apll>, <apll>2<_J/>3</apll> (both equal to <apll>2+3×√¯1</apll>)
*** <apll>2<_ad/>3</apll> (Angle in Degrees)
*** <apll>2<_ar/>3</apll> (Angle in Radians)
*** <apll>2<_au/>3</apll> (Angle in Unit Normalized), or
*** <apll>2<_ah/>3</apll> (Angle in Half Unit Normalized)
** Quaternion: <apll>1<_i/>2<_j/>3<_k/>4</apll>
** Octonion: <apll>1<_i/>2<_j/>3<_k/>4<_l/>5<_ij/>6<_jk/>7<_kl/>8</apll>.
** '''Rational''' <apll>2<_r/>3</apll> is a shorthand for <apll>2÷3</apll> as a Multiple-Precision Integer/Rational number.
** '''Variable-Precision Floating''' <apll>2.3<_v/></apll> is a shorthand for <apll>2.3</apll> as a Multiple-Precision Floating Point number.
** '''Ball Arithmetic''' — <apll>2.3<_pom/>1<_E/>¯17</apll> is a shorthand for a Ball whose Midpoint and Radius are <apll>2.3</apll> and <apll>1<_E/>¯17</apll>, respectively.
* [[Trains]]:  e.g., <apll>avg←(+⌿ ÷ ≢)</apll> applies the functions to its argument(s) in a particular way (in this case, to compute the average of a numeric scalar or vector).
* [[Trains]]:  e.g., <apll>avg←(+⌿ ÷ ≢)</apll> 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 <apll>{(+⌿⍵)÷≢⍵}</apll>.
* [[Anonymous Functions/Operators/Hyperators]]:  multi-line grouping of one or more statements all enclosed in braces such as <apll>{(+⌿⍵)÷≢⍵}</apll>.


==Primitive functions==
==Primitive Functions==
* [[Array Lookup]]:  <apll>L⍸R</apll>
* [[Condense]]:  <apll>&lt;[X] R</apll>
* [[Dilate]]:  <apll>&gt;[X] R</apll>
* [[Expand]]:  <apll>L\[X] R</apll>
* [[Find]]:  <apll>L⍷R</apll>
* [[Index Generator]]:  <apll>⍳R</apll>
* [[Index Of]]:  <apll>L⍳R</apll>
* [[Indexing]]:  <apll>R[L]</apll>, &nbsp;&nbsp;<apll>R[L]←A</apll>, &nbsp;&nbsp;<apll>R[L]<i>f</i>←A</apll>, &nbsp;&nbsp;<apll>L⌷R</apll>, &nbsp;&nbsp;<apll>L⍉R</apll>, &nbsp;&nbsp; <apll>L⊃R</apll>
* [[Indices]]:  <apll>⍸R</apll>
* [[Matrix Inverse/Divide]]:  <apll>⌹R</apll>, &nbsp;&nbsp;<apll>L⌹R</apll>
* [[Mismatch]]:  <apll>L≢R</apll>
* [[Partitioned Enclose]]:  <apll>L⊂[X] R</apll>
* [[Primes]]: <apll>πR</apll> and <apll>LπR</apll>
* [[Reshape]]:  <apll>L⍴R</apll>
* [[Root]]:  <apll>√R</apll> and <apll>L√[X] R</apll>
* [[Sequence]]:  <apll>L..R</apll>
* [[Sets]]:  <apll>L§R</apll>, <apll>L⊆R</apll>, <apll>L⊇R</apll>
* [[Tally]]:  <apll>≢R</apll>
* [[Without]]:  <apll>L~R</apll>


==Primitive operators==
{| border="0" cellpadding="5" cellspacing="0"
|'''Name'''||    '''Symbol/Syntax'''||'''Function Valence'''
|-
|[[Array Lookup]]||    <apll>L⍸R</apll>    ||dyadic
|-
|[[Condense]]||    <apll>&lt;[X] R</apll>    ||monadic
|-
|[[Dilate]]||    <apll>&gt;[X] R</apll>    ||monadic
|-
|[[Expand]]||    <apll>L\[X] R</apll>    ||dyadic
|-
|[[Find]]||    <apll>L⍷R</apll>    ||dyadic
|-
|[[Index Generator]]||    <apll>⍳R</apll>    ||monadic
|-
|[[Index Of]]||    <apll>L⍳R</apll>    ||dyadic
|-
|[[Indexing]]||    <apll>R[L]</apll>,&nbsp;&nbsp;&nbsp;<apll>R[L]←A</apll>,&nbsp;&nbsp;&nbsp;<apll>R[L]f←A</apll>,&nbsp;&nbsp;&nbsp;<apll>L⌷[X] R</apll>,    &nbsp;&nbsp;&nbsp;<apll>L⍉R</apll>,&nbsp;&nbsp;&nbsp;<apll>L⊃R</apll>&nbsp;&nbsp;&nbsp; ||dyadic
|-
|[[Indices]]||    <apll>⍸R</apll>    ||monadic
|-
|[[Matrix Inverse/Divide]]||    <apll>⌹R</apll>,&nbsp;&nbsp;&nbsp;<apll>L⌹R</apll>    ||ambivalent
|-
|[[Mismatch]]||    <apll>L≢R</apll>    ||dyadic
|-
|[[Partitioned Enclose]]||    <apll>L⊂[X] R</apll>    ||dyadic
|-
|[[Primes]]||    <apll>πR</apll>,&nbsp;&nbsp;&nbsp;<apll>LπR</apll>    ||ambivalent
|-
|[[Reshape]]||    <apll>L⍴R</apll>    ||dyadic
|-
|[[Root]]||    <apll>√R</apll>,&nbsp;&nbsp;&nbsp;<apll>L√[X] R</apll>    ||ambivalent
|-
|[[Sequence]]||    <apll>L..R</apll>    ||dyadic
|-
|[[Sets]]||    <apll>L§R</apll>,&nbsp;&nbsp;&nbsp;<apll>L⊆R</apll>,&nbsp;&nbsp;&nbsp;<apll>L⊇R</apll>    ||dyadic
|-
|[[Tally]]||    <apll>≢R</apll>    ||monadic
|-
|[[Without]]||    <apll>L~R</apll>    ||dyadic
|}


{| border="0" cellpadding="0" cellspacing="0"
where <apll>L</apll> is the Left argument, <apll>R</apll> is the Right argument, and <apll>[X]</apll> is an optional Axis value.
|<big>'''Name'''</big>|| &nbsp;&nbsp;&nbsp; <big>'''Symbol/Syntax'''</big>||<big>'''Derived Function Valence'''</big>
 
==Primitive Operators==
 
{| border="0" cellpadding="5" cellspacing="0"
|'''Name'''||    '''Symbol/Syntax'''||'''Derived Function Valence'''
|-
|[[At]]||      <apll>a@b R</apll>, <apll>a@f R</apll>, <apll>{L} f@b R</apll>, <apll>{L} f@g R</apll>      ||monadic/ambivalent
|-
|[[Axis]]||    <apll>{L} f[X] R</apll>,&nbsp;&nbsp;&nbsp;<apll>{L} f op1[X] R</apll>,&nbsp;&nbsp;&nbsp;<apll>{L} f op2[X] g R</apll> ||ambivalent
|-
|[[Combinatorial]]||    <apll>a‼ R</apll>    ||monadic
|-
|[[Commutator]]||    <apll>{L} f⍫g R</apll>    ||ambivalent
|-
|[[Commute-Duplicate|Commute]]||    <apll>L f⍨ R ←→ R f L</apll>    ||dyadic
|-
|[[Compose]]||    <apll>{L} f∘g R</apll>,&nbsp;&nbsp;&nbsp;<apll>f∘b R</apll>,&nbsp;&nbsp;&nbsp;<apll>a∘g R</apll> ||ambivalent/monadic
|-
|[[Composition]]||    <apll>{L} f⍥g R</apll>   ||ambivalent
|-
|-
|[[Axis]]|| &nbsp;&nbsp;&nbsp; <apll>{L} <i>f</i>[<i>X</i>] R</apll>, &nbsp;&nbsp; <apll>{L} (<i>f op1</i>[<i>X</i>]) R</apll>, &nbsp;&nbsp; <apll>{L} (<i>f op2</i>[<i>X</i>] <i>g</i>) R</apll> &nbsp;&nbsp;&nbsp; ||monadic/dyadic
|[[Convolution]]||     <apll>L f⍡g R</apll>   ||dyadic
|-
|-
|[[Combinatorial]]|| &nbsp;&nbsp;&nbsp; <apll><i>a</i>‼ R</apll> &nbsp;&nbsp;&nbsp;||monadic
|[[Derivative]]||     <apll>{L} f∂[X] R</apll>,&nbsp;&nbsp;&nbsp;<apll>{L} f∂∂[X] R</apll>, etc.  ||ambivalent
|-
|-
|[[Commute-Duplicate|Commute]]|| &nbsp;&nbsp;&nbsp; <apll>L <i>f</i>⍨ R ←→ R <i>f</i> L</apll> &nbsp;&nbsp;&nbsp;||dyadic
|[[Determinant Operator|Determinant]]||     <apll>f.g R</apll>   ||monadic
|-
|-
|[[Composition]]|| &nbsp;&nbsp;&nbsp; <apll>{L} <i>f</i>⍥<i>g</i> R</apll> &nbsp;&nbsp;&nbsp;||monadic/dyadic
|[[Dual]]||     <apll>{L} f⍢g R</apll>     || ambivalent
|-
|-
|[[Compose]]|| &nbsp;&nbsp;&nbsp; <apll>{L} <i>f</i>∘<i>g</i> R</apll>, &nbsp;&nbsp; <apll>(<i>f</i>∘<i>b</i>) R</apll>, &nbsp;&nbsp; <apll><i>a</i>∘<i>g</i> R</apll> &nbsp;&nbsp;&nbsp;||monadic/dyadic
|[[Commute-Duplicate|Duplicate]]||     <apll>f⍨ R ←→ R f R</apll>   ||monadic
|-
|-
|[[Convolution]]|| &nbsp;&nbsp;&nbsp; <apll>L <i>f</i>⍡<i>g</i> R</apll> &nbsp;&nbsp;&nbsp;||dyadic
|[[Integral]]||     <apll>{L} f<_sg/>[X] R</apll>   ||ambivalent
|-
|-
|[[Determinant Operator|Determinant]]|| &nbsp;&nbsp;&nbsp; <apll><i>f</i>.<i>g</i> R</apll> &nbsp;&nbsp;&nbsp;||monadic
|[[Power#Inverses|Inverses]]||     <apll>{L} f⍣¯1 R</apll>   ||ambivalent
|-
|-
|[[Commute-Duplicate|Duplicate]]|| &nbsp;&nbsp;&nbsp; <apll><i>f</i>⍨ R ←→ R <i>f</i> R</apll> &nbsp;&nbsp;&nbsp;||monadic
|[[Compose#Mask|Mask]]||     <apll>L (a∘/) R</apll>,&nbsp;&nbsp;&nbsp;<apll>L (a∘⌿) R</apll>,&nbsp;&nbsp;&nbsp;<apll>L (a∘/[X]) R</apll>    ||dyadic
|-
|-
|[[Matrix]]|| &nbsp;&nbsp;&nbsp; <apll>{L} <i>f</i>⌻ R</apll>, &nbsp;&nbsp; <apll>∘⌻ R</apll> &nbsp;&nbsp;&nbsp;||monadic/dyadic
|[[Matrix]]||     <apll>{L} f⌻ R</apll>,&nbsp;&nbsp;&nbsp;<apll>∘⌻ R</apll>   ||ambivalent/monadic
|-
|-
|[[Multisets]]|| &nbsp;&nbsp;&nbsp; <apll>{L} <i>f</i>⍦ R</apll> &nbsp;&nbsp;&nbsp;||monadic/dyadic
|[[Compose#Mesh|Mesh]]||     <apll>L (a∘\) R</apll>,&nbsp;&nbsp;&nbsp;<apll>L (a∘⍀) R</apll>,&nbsp;&nbsp;&nbsp;<apll>L (a∘\[X]) R</apll>    ||dyadic
|-
|-
|[[Null]]|| &nbsp;&nbsp;&nbsp; <apll>{L} <i>f</i>⊙ R</apll> &nbsp;&nbsp;&nbsp;||monadic/dyadic
|[[Multisets]]||     <apll>{L} f⍦ R</apll>   ||ambivalent
|-
|-
|[[Power]]|| &nbsp;&nbsp;&nbsp; <apll>{L} <i>f</i/>⍣<i>g</i> R</apll>, &nbsp;&nbsp;  <apll>{L} (<i>f</i/>⍣<i>b</i>) R</apll> &nbsp;&nbsp;&nbsp;||monadic/dyadic
|[[Null]]||     <apll>{L} f⊙ R</apll>   ||ambivalent
|-
|-
|[[Rank]]|| &nbsp;&nbsp;&nbsp; <apll>{L} (<i>f</i>⍤[<i>X</i>] <i>b</i>) R</apll> &nbsp;&nbsp;&nbsp;||monadic/dyadic
|[[Power]]||     <apll>{L} f⍣g R</apll>,&nbsp;&nbsp;&nbsp;<apll>{L} f⍣b R</apll>   ||ambivalent
|-
|-
|[[Variant]]|| &nbsp;&nbsp;&nbsp; <apll>{L} (<i>f</i><i>b</i>) R</apll> &nbsp;&nbsp;&nbsp;||monadic/dyadic
|[[Rank/Atop]]||     <apll>{L} f⍤[X] b R</apll>,&nbsp;&nbsp;&nbsp;<apll>{L} f⍤g R</apll>     ||ambivalent
|-
|[[Variant]]||    <apll>{L} f⍠b R</apll>   ||ambivalent
|}
|}


where <apll>{L}</apll> is an optional Left argument, <apll>R</apll> is the Right argument, <apll><i>f</i></apll> and <apll><i>g</i></apll> represent Functions, <apll><i>a</i></apll> and <apll><i>b</i></apll> represent Variables, and <apll>[<i>X</i>]</apll> is an optional Axis value.
where <apll>{L}</apll> is an optional Left argument, <apll>R</apll> is the Right argument, <apll>f</apll> and <apll>g</apll> represent Functions, <apll>a</apll> and <apll>b</apll> represent Variables, and <apll>[X]</apll> is an optional Axis value.
 
==Primitive Hyperators==
 
{| border="0" cellpadding="5" cellspacing="0"
|'''Name'''||    '''Symbol/Syntax'''||'''Derived Function Valence'''
|-
|[http://www.sudleyplace.com/APL/A%20Transform%20Hyperator%20in%20APL.pdf Transform]||    <apll>f h⍑g R</apll>    ||monadic
|}
 
where <apll>{L}</apll> is an optional Left argument, <apll>R</apll> is the Right argument, <apll>f</apll> and <apll>g</apll> represent Functions, <apll>h</apll> represents a Function/Operator, and <apll>[X]</apll> is an optional Axis value.
 
Also, see [[Hyperators]].


==Datatypes==
==Datatypes==
* [[Infinity]]:  <apll>∞</apll> and <apll>¯∞</apll>
* [[Infinity]]:  <apll>∞</apll> and <apll>¯∞</apll>
* [[NaN]]:  <apll>∅</apll>
* [[APA|Arithmetic Progression Arrays]]:  <apll>2 3 4⍴⍳24</apll>
* [[APA|Arithmetic Progression Arrays]]:  <apll>2 3 4⍴⍳24</apll>
* [[Unicode|Unicode Characters]]
* [[Unicode|Unicode Characters]]
* [[Array Predicates]]
* [[Array Predicates]]
* [[Rational and VFP Numbers|Rational Numbers]]:  <apll>1<pn>r</pn>3</apll> and <apll>12345<pn>x</pn></apll>
* [[Rational and VFP Numbers|Rational Numbers]]:  <apll>1<_r/>3</apll> and <apll>12345<_x/></apll>
* [[Rational and VFP Numbers|Variable-precision Floating Point (VFP) Numbers]]:  <apll>1.234<pn>v</pn></apll> and <apll>12<pn>v</pn></apll>
* [[Rational and VFP Numbers|Variable-precision Floating Point (VFP) Numbers]]:  <apll>1.234<_v/></apll> and <apll>12<_v/></apll>
* Complex Numbers:  <apll>1<hc>J</hc>2</apll> or <apll>3.4<hc>i</hc>5</apll> or <apll>2<hc>ad</hc>90</apll> or <apll>2<hc>ar</hc>2.1</apll> or <apll>2<hc>au</hc>0.5</apll>
* [http://www.sudleyplace.com/APL/Hypercomplex%20Numbers%20in%20APL.pdf Complex Numbers]:  <apll>1<_i/>2</apll> or <apll>3.4<_i/>5</apll> or <apll>2<_ad/>90</apll> or <apll>22<_ar/>.1</apll> or <apll>20<_au/>.5</apll>
* Quaternion Numbers:  <apll>1<hc>i</hc>2<hc>j</hc>3<hc>k</hc>4</apll>
* [http://www.sudleyplace.com/APL/Hypercomplex%20Numbers%20in%20APL.pdf Quaternion Numbers]:  <apll>1<_i/>2<_j/>3<_k/>4</apll>
* Octonion Numbers:  <apll>1<hc>i</hc>2<hc>j</hc>3<hc>k</hc>4<hc>l</hc>5<hc>ij</hc>6<hc>jk</hc>7<hc>kl</hc>8</apll>
* [http://www.sudleyplace.com/APL/Hypercomplex%20Numbers%20in%20APL.pdf Octonion Numbers]:  <apll>1<_i/>2<_j/>3<_k/>4<_l/>5<_ij/>6<_jk/>7<_kl/>8</apll>
* [[Ball Arithmetic]]:  <apll>2.3<_pom/></apll> is a shorthand for a Ball whose Midpoint and Radius are <apll>2.3</apll> and <apll>2*¯53</apll>, respectively, because the Midpoint (<apll>2.3</apll>) cannot be represented exactly in double-precision floating point format with the standard <apll>53</apll> bits of precision.
 
==Java Support==
The Java programming language is now supported.  You can now write code in Java, and call it from APL.  For more details, see [[Java_Support|Java Support]].


==System Commands==
==System Commands==

Latest revision as of 14:50, 8 July 2024

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
  • Modified Assignment: Af←R
  • Modify Strand Assignment: (A1 A2 ... An)f←R
  • Hyperators: ∇ Z←L (LO (LH dhdo RH) RO) R
  • Function/Operator/Hyperator Assignment: A←f,      A←op1,      A←op2
  • Binding Strength: How Variables, Functions, Operators, Hyperators and other syntactic elements combine
  • Sink: ←R
  • Point Notation:
    • Base16b10FFFF is a shorthand for 16⊥1 0 15 15 15 15 and 10b45v is a shorthand for 10⊥4 5 31.
    • Euler2x3 is a shorthand for 2∙e3 or 2×(*1)*3 where e is Euler's Number (2.718281828459045...).
    • Pi2p3 is a shorthand for 2∙π3 or 2×(○1)*3 where π is Archimedes' constant (3.141592653589793...).
    • Gamma2g3 is a shorthand for 2∙γ3 where γ is Euler-Mascheroni's Constant (0.5772156649015329...).
    • Zeta2z3 is a shorthand for 2∙ζ(3) where ζ(x) is the Riemann Zeta function.
    • Complex:
      • 2i3, 2J3 (both equal to 2+3×√¯1)
      • 2ad3 (Angle in Degrees)
      • 2ar3 (Angle in Radians)
      • 2au3 (Angle in Unit Normalized), or
      • 2ah3 (Angle in Half Unit Normalized)
    • Quaternion: 1i2j3k4
    • Octonion: 1i2j3k4l5ij6jk7kl8.
    • Rational2r3 is a shorthand for 2÷3 as a Multiple-Precision Integer/Rational number.
    • Variable-Precision Floating2.3v is a shorthand for 2.3 as a Multiple-Precision Floating Point number.
    • Ball Arithmetic2.3±1E¯17 is a shorthand for a Ball whose Midpoint and Radius are 2.3 and 1E¯17, respectively.
  • 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/Hyperators: 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

Name Symbol/Syntax Derived Function Valence
At a@b R, a@f R, {L} f@b R, {L} f@g R monadic/ambivalent
Axis {L} f[X] R,   {L} f op1[X] R,   {L} f op2[X] g R ambivalent
Combinatorial a‼ R monadic
Commutator {L} f⍫g R ambivalent
Commute L f⍨ R ←→ R f L dyadic
Compose {L} f∘g R,   f∘b R,   a∘g R ambivalent/monadic
Composition {L} f⍥g R ambivalent
Convolution L f⍡g R dyadic
Derivative {L} f∂[X] R,   {L} f∂∂[X] R, etc. ambivalent
Determinant f.g R monadic
Dual {L} f⍢g R ambivalent
Duplicate f⍨ R ←→ R f R monadic
Integral {L} f[X] R ambivalent
Inverses {L} f⍣¯1 R ambivalent
Mask L (a∘/) R,   L (a∘⌿) R,   L (a∘/[X]) R dyadic
Matrix {L} f⌻ R,   ∘⌻ R ambivalent/monadic
Mesh L (a∘\) R,   L (a∘⍀) R,   L (a∘\[X]) R dyadic
Multisets {L} f⍦ R ambivalent
Null {L} f⊙ R ambivalent
Power {L} f⍣g R,   {L} f⍣b R ambivalent
Rank/Atop {L} f⍤[X] b R,   {L} f⍤g R ambivalent
Variant {L} f⍠b R ambivalent

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.

Primitive Hyperators

Name Symbol/Syntax Derived Function Valence
Transform f h⍑g R monadic

where {L} is an optional Left argument, R is the Right argument, f and g represent Functions, h represents a Function/Operator, and [X] is an optional Axis value.

Also, see Hyperators.

Datatypes

Java Support

The Java programming language is now supported. You can now write code in Java, and call it from APL. For more details, see Java Support.

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
)NMS
)OFF Close down the interpreter and exit the program. Same as )EXIT
)OPEN
)OPS Display operators only
)OUT
)RESET
)SAVE Save the current workspace
)SVAE Alternative spelling for )SAVE
)SI workspace State Indicator
)SIC State Indicator Clear
)SINL
)SYMB
)ULIB
)VARS
)XLOAD
)WSID
 

System Variables and Functions

System Variables (A value may be assigned to these except for ⎕DM)
ALX CT DM DT ELX FC FEATURE FPC IC IO
LR LX PP PR PW RL SA WSID
Niladic System Functions (a value cannot be assigned to these)
A AV EM ET LC NNAMES NNUMS SI SYSID SYSVER
T TC TCBEL TCBS TCESC TCFF TCHT TCLF TCNL TCNUL
TS WA
Monadic or dyadic system functions (a value cannot be assigned to these)
AT CR DC DFT DL DR EA EC ERROR ES
EX FMT FX MF NAPPEND NC NCREATE NERASE NINFO NL
NLOCK NREAD NRENAME NREPLACE NRESIZE NSIZE NTIE NUNTIE STOP TF
TRACE UCS VR
Note that quad functions and variables (except for the ⎕A family of functions) are case insensitive