Array notation design considerations: Difference between revisions

Jump to navigation Jump to search
→‎2016: Corrected factually incorrect assertion: "Again, the notation was only described as a serialisation format; not as an integral part of the language."
(expand intro)
(→‎2016: Corrected factually incorrect assertion: "Again, the notation was only described as a serialisation format; not as an integral part of the language.")
Line 98: Line 98:


=== 2016 ===
=== 2016 ===
Phil Last published a more formal proposal in the [[Vector Journal]]. Again, the notation was only described as a serialisation format; not as an integral part of the language. He added escape sequences to [[string]]s, further distancing the notation from compatibility with existing APL code.<ref>Last, Phil. [http://archive.vector.org.uk/art10501450 A Notation for APL array Embedding and Serialization]. Vector Journal, Volume 26, number 4. [[British APL Association]]. 2016.</ref>
Phil Last published a more formal proposal in the [[Vector Journal]] where he emphasised the need for such a notation to become an integral part of the language. He added escape sequences to [[string]]s, further distancing the notation from compatibility with existing APL code.<ref>Last, Phil. [http://archive.vector.org.uk/art10501450 A Notation for APL array Embedding and Serialization]. Vector Journal, Volume 26, number 4. [[British APL Association]]. 2016.</ref>


[[File:D11 Literal Notation for Arrays and Namespaces - Summary of notations.png|thumb|right|Array notation at [[Dyalog '17]].]]
[[File:D11 Literal Notation for Arrays and Namespaces - Summary of notations.png|thumb|right|Array notation at [[Dyalog '17]].]]
===2017===
===2017===
At [[Dyalog '17]], Adám Brudzewsky proposed an alternative notation using round parentheses to indicate collections of major cells of any rank, thus allowing the notation to express [[nested]] vectors though [[scalar]] major cells, for example <syntaxhighlight lang=apl inline>(⊂1 2 3 ⋄ ⊂4 5 6)</syntaxhighlight> would be equivalent to <syntaxhighlight lang=apl inline>(1 2 3)(4 5 6)</syntaxhighlight>. This notation had a striking similarity to the informal notation used in the [[NARS]] reference manual over 35 years prior. For namespace, he proposed using colon (<syntaxhighlight lang=apl inline>:</syntaxhighlight>) to delimit [[wikipedia:name-value pair|name-value pair]]s, inspired by [[wikipedia:JSON|JSON]] in which colon is used in the same manner, despite assignment being denoted by <syntaxhighlight lang=javascript inline>=</syntaxhighlight> in [[wikipedia:JavaScript|JavaScript]], from which JSON was derived. This distinction allowed arbitrary expressions in arrays, opening the possibility of full integration into the language, while also allowing a namespace with no members to be denoted <syntaxhighlight lang=apl inline>()</syntaxhighlight>. Last's proposal required <syntaxhighlight lang=apl inline>[:]</syntaxhighlight> to distinguish it from [[bracket indexing]] into a vector while eliding the indices, a technique used to address all [[element]]s.
At [[Dyalog '17]], Adám Brudzewsky proposed an alternative notation using round parentheses to indicate collections of major cells of any rank, thus allowing the notation to express [[nested]] vectors though [[scalar]] major cells, for example <syntaxhighlight lang=apl inline>(⊂1 2 3 ⋄ ⊂4 5 6)</syntaxhighlight> would be equivalent to <syntaxhighlight lang=apl inline>(1 2 3)(4 5 6)</syntaxhighlight>. This notation had a striking similarity to the informal notation used in the [[NARS]] reference manual over 35 years prior. For namespace, he proposed using colon (<syntaxhighlight lang=apl inline>:</syntaxhighlight>) to delimit [[wikipedia:name-value pair|name-value pair]]s, inspired by [[wikipedia:JSON|JSON]] in which colon is used in the same manner, despite assignment being denoted by <syntaxhighlight lang=javascript inline>=</syntaxhighlight> in [[wikipedia:JavaScript|JavaScript]], from which JSON was derived. This distinction allowed arbitrary expressions in arrays, opening the possibility of full integration into the language, while also allowing a namespace with no members to be denoted <syntaxhighlight lang=apl inline>()</syntaxhighlight>. Last's proposal required <syntaxhighlight lang=apl inline>[:]</syntaxhighlight> to distinguish it from [[bracket indexing]] into a vector while eliding the indices, a technique used to address all [[element]]s.
19

edits

Navigation menu