Array notation: Difference between revisions

Jump to navigation Jump to search
754 bytes added ,  16:58, 19 August 2022
→‎History: Nial, and older predecessors outside the APL family
m (list → vector)
(→‎History: Nial, and older predecessors outside the APL family)
Line 38: Line 38:
:''See also [[Array notation in Dyalog APL]]''
:''See also [[Array notation in Dyalog APL]]''


A predecessor of array notation is the list notation used by both [[A+]] and [[K]], with parenthesis-and-semicolon syntax like <source lang=apl inline>(a;b;c)</source>. In A+ this is related to [[bracket indexing]] and an "expression group" notation written with curly braces and semicolons. It allows line breaks, but in addition to rather than in place of semicolons. The later K version corresponds more closely to APL: the semicolon is a statement separator and is interchangeable with a line break, and because K represents arrays with nested lists, it corresponds to both vector and high-rank array notation.
One-dimensional list syntax with surrounding brackets and delimiters, matching [[wikipedia:sequence|sequence]] notation in mathematics, is common in programming. It appears as early as [[wikipedia:ALGOL 68|ALGOL 68]] with parentheses, and square-bracket lists or arrays feature in languages from the 1970s such as [[wikipedia:ML (programming language)|ML]] and [[wikipedia:Icon (programming language)|Icon]]. [[MATLAB]] uses matrix syntax with square brackets, semicolons to separate rows, and commas to separate columns.
 
List notation appears in [[Nial]], with brackets and commas like <source lang=apl inline>[a,b,c]</source>, and in [[A+]] and [[K]], with parentheses and semicolons like <source lang=apl inline>(a;b;c)</source>. In A+ this is related to [[bracket indexing]] and an "expression group" notation written with curly braces and semicolons. It allows line breaks, but in addition to rather than in place of semicolons. The later K version corresponds more closely to APL: the semicolon is a statement separator and is interchangeable with a line break, and because K represents arrays with nested lists, it corresponds to both vector and high-rank array notation. In all three languages this syntax can be used with functions, as functions are first-class in A+ and K, and arrays of functions called "atlases" can be used for specific purposes in Nial.


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

Navigation menu