Array notation: Difference between revisions

Jump to navigation Jump to search
1,701 bytes added ,  21:37, 19 August 2022
→‎History: Getting complicated, time for a table
(→‎History: Acre, Dyalog, dzaima/APL, and BQN history)
(→‎History: Getting complicated, time for a table)
Line 45: Line 45:


[[dzaima/APL]] added support for vector notation with parentheses in 2018, namespaces and function arrays in 2019, and high-rank arrays with square brackets in 2020. [[BQN]] supported lists with angle brackets <source inline>⟨⟩</source> in its initial implementation in 2020; square brackets were reserved for high-rank array notation, which was implemented in 2022.
[[dzaima/APL]] added support for vector notation with parentheses in 2018, namespaces and function arrays in 2019, and high-rank arrays with square brackets in 2020. [[BQN]] supported lists with angle brackets <source inline>⟨⟩</source> in its initial implementation in 2020; square brackets were reserved for high-rank array notation, which was implemented in 2022.
=== Language support ===
The following languages support list or vector notation in some form. In K, all APLs, and BQN, the separators <source inline>;</source> and <source inline>⋄</source> indicate any separator, including a line break.
{| class=wikitable
! Language              !! Vectors                    !! High-rank                  !! [[Namespace]]s                    !! [[Function array]]s
|-
| [[Nial]]              || <source inline>[,]</source> ||                            ||                                    || {{Yes}}
|-
| [[A+]]                || <source inline>[;]</source> ||                            ||                                    || {{Maybe|First class}}
|-
| [[K]]                || <source inline>[;]</source> ||                            ||                                    || {{Maybe|First class}}
|-
| [[dzaima/APL]]        || <source inline>(⋄)</source> || <source inline>[⋄]</source> || <source inline>(key:val⋄)</source> || {{Yes}}
|-
| [[BQN]]              || <source inline>⟨⋄⟩</source> || <source inline>[⋄]</source> || <source inline>{key⇐val⋄}</source> || {{Maybe|First class}}
|-
| [[Dyalog]] (proposed) || <source inline>(⋄)</source> || <source inline>[⋄]</source> || <source inline>(key:val⋄)</source> || {{No}}
|}
"First class" indicates that functions are first class, so that an array of functions can be formed directly; in Nial and dzaima/APL function arrays are a special form that can be applied to arguments to return a list of results. BQN's namespaces don't use a dedicated construction; instead, any block (like a [[dfn]]) with <source inline>⇐</source> statements returns a namespace reference.


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

Navigation menu