Template:Comparison of array notations: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Created page with "== Comparison of array notations == The following systems support list or vector notation in some form, beyond simple strand notation. The separators <code>;</code> in A+...")
 
(Add TinyAPL)
 
Line 19: Line 19:
|-
|-
| Acre Desktop<ref>The Carlisle Group. [https://github.com/the-carlisle-group/Acre-Desktop/wiki/APL-Array-Notation APL Array Notation]. Acre Desktop Wiki. GitHub. Retrieved 2022-09-01.</ref> || {{Yes|<code>(⋄)</code>}} || {{Yes|<code>[⋄]</code>}} || {{Yes|<code>[key←val⋄]</code>}} || {{No}}  || {{Maybe|N/A}}
| Acre Desktop<ref>The Carlisle Group. [https://github.com/the-carlisle-group/Acre-Desktop/wiki/APL-Array-Notation APL Array Notation]. Acre Desktop Wiki. GitHub. Retrieved 2022-09-01.</ref> || {{Yes|<code>(⋄)</code>}} || {{Yes|<code>[⋄]</code>}} || {{Yes|<code>[key←val⋄]</code>}} || {{No}}  || {{Maybe|N/A}}
|-
| [[TinyAPL]]          || {{Yes|<code>⟨⋄⟩</code>}} || {{Yes|<code>[⋄]</code>}} || {{Yes|<code>⦃key←val⋄⦄</code>}} || {{Yes|First-class}} || {{Yes}}
|}
|}


Nial and A+ do not support namespaces, while K does not support high-rank arrays, so any such notation is not applicable. The "Function arrays" column indicates whether functions can be placed in array notation. "First class" indicates that functions are first class, so this is possible without special consideration. "Special" indicates creating a special vectors of functions that can be applied to arguments to return a list of results. The "Assignable" column indicates that array notation can be used as an assignment target to perform [[wikipedia:Assignment_(computer_science)#Parallel_assignment|destructuring]]. BQN's namespaces don't use a dedicated construction; instead, any block (like a [[dfn]]) with <code>⇐</code> statements returns a namespace reference. Acre Desktop only uses array notation for storing literal arrays; it cannot appear in executable code.
Nial and A+ do not support namespaces, while K does not support high-rank arrays, so any such notation is not applicable. The "Function arrays" column indicates whether functions can be placed in array notation. "First class" indicates that functions are first class, so this is possible without special consideration. "Special" indicates creating a special vectors of functions that can be applied to arguments to return a list of results. The "Assignable" column indicates that array notation can be used as an assignment target to perform [[wikipedia:Assignment_(computer_science)#Parallel_assignment|destructuring]]. BQN's namespaces don't use a dedicated construction; instead, any block (like a [[dfn]]) with <code>⇐</code> statements returns a namespace reference. Acre Desktop only uses array notation for storing literal arrays; it cannot appear in executable code.

Latest revision as of 09:09, 31 October 2024

Comparison of array notations

The following systems support list or vector notation in some form, beyond simple strand notation. The separators ; in A+ and K, and in APL and BQN, indicate any separator, including a line break.

System Vectors High-rank Namespaces Function arrays Assignable
Nial [,] No N/A Special No
A+ (;) No N/A First-class Yes
K (;) N/A [key:val;] First-class Yes
BQN[1] ⟨⋄⟩ [⋄] {key⇐val⋄} First-class Yes
dzaima/APL (⋄) [⋄] (key:val⋄) Special No
Dyalog Link (⋄) [⋄] (key:val⋄) No No
Acre Desktop[2] (⋄) [⋄] [key←val⋄] No N/A
TinyAPL ⟨⋄⟩ [⋄] ⦃key←val⋄⦄ First-class Yes

Nial and A+ do not support namespaces, while K does not support high-rank arrays, so any such notation is not applicable. The "Function arrays" column indicates whether functions can be placed in array notation. "First class" indicates that functions are first class, so this is possible without special consideration. "Special" indicates creating a special vectors of functions that can be applied to arguments to return a list of results. The "Assignable" column indicates that array notation can be used as an assignment target to perform destructuring. BQN's namespaces don't use a dedicated construction; instead, any block (like a dfn) with statements returns a namespace reference. Acre Desktop only uses array notation for storing literal arrays; it cannot appear in executable code.

  1. Lochbaum, Marshall. BQN: Array notation and display; Array literals. Retrieved 2022-09-01.
  2. The Carlisle Group. APL Array Notation. Acre Desktop Wiki. GitHub. Retrieved 2022-09-01.