Array notation design considerations: Difference between revisions

Jump to navigation Jump to search
m (edit mistake)
Line 119: Line 119:
[[APL Germany]]'s 2020 journal also included a description of the notation, including a discussion of potential issues with [[assignment]].<ref>Brudzewsky, Adám. [https://apl-germany.de/wp-content/uploads/2021/11/APL_Journal_2020_1u2.pdf#page=34 A Notation for APL Arrays]. APL-Journal, Volume 2020, number 1-2. [[APL Germany|APL-Germany e.V.]] 2020.</ref>
[[APL Germany]]'s 2020 journal also included a description of the notation, including a discussion of potential issues with [[assignment]].<ref>Brudzewsky, Adám. [https://apl-germany.de/wp-content/uploads/2021/11/APL_Journal_2020_1u2.pdf#page=34 A Notation for APL Arrays]. APL-Journal, Volume 2020, number 1-2. [[APL Germany|APL-Germany e.V.]] 2020.</ref>


== Language comparison ==
{{Template: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+ and K, and <code>⋄</code> in APL and BQN, indicate any separator, including a line break.
 
{| class=wikitable
! Language              !! Vectors          !! High-rank        !! [[Namespace]]s          !! [[Function array]]s  !! Assignable
|-
| [[Nial]]              || <code>[,]</code> ||                  ||                        || {{Yes}}              || {{No}}
|-
| [[A+]]                || <code>(;)</code> ||                  ||                        || {{Maybe|First-class}} || {{Yes}}
|-
| [[K]]                || <code>(;)</code> ||                  ||                        || {{Maybe|First-class}} || {{Yes}}
|-
| [[dzaima/APL]]        || <code>(⋄)</code> || <code>[⋄]</code> || <code>(key:val⋄)</code> || {{Yes}}              || {{No}}
|-
| [[BQN]]<ref>[[Marshall Lochbaum|Lochbaum, Marshall]]. [https://mlochbaum.github.io/BQN/doc/arrayrepr.html#array-literals BQN: Array notation and display; Array literals]. Retrieved 2022-09-01.</ref> || <code>⟨⋄⟩</code> || <code>[⋄]</code> || <code>{key⇐val⋄}</code> || {{Maybe|First-class}} || {{Yes}}
|-
| [[Dyalog Link]]      || <code>(⋄)</code> || <code>[⋄]</code> || <code>(key:val⋄)</code> || {{No|No (indirect)}}  || {{No}}
|-
| 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> || <code>(⋄)</code> || <code>[⋄]</code> || <code>[key←val⋄]</code> || {{No}}  || {{Maybe|N/A}}
|}
 
The "Function arrays" column indicates whether functions can be placed in array notation ([[function array]]s can be created in Dyalog by another method). "First class" indicates that functions are first class, so this is possible without special consideration; in Nial and dzaima/APL vectors of functions are a special form 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 <code>⇐</code> statements returns a namespace reference. Acre Desktop only uses array notation for storing literal arrays; it cannot appear in executable code.


== References ==
== References ==
<references/>
<references/>
{{APL syntax}}[[Category:APL syntax]][[Category:Nested array model]]
{{APL syntax}}[[Category:APL syntax]][[Category:Nested array model]]

Navigation menu