Array model: Difference between revisions

Jump to navigation Jump to search
179 bytes added ,  12:46, 22 June 2021
→‎Nested array theory: quote by Scholes
(It is clearly in APL except for the sparse array part, which has to be in J)
(→‎Nested array theory: quote by Scholes)
Line 37: Line 37:


A second version of the APL array model was developed in order to more transparently handle nested data, without the need to explicitly box and unbox arrays. The Nested Array Research System ([[NARS]]) was developed to study this model. In it, arrays contain other arrays directly. In this way they resemble the [[wikipedia:inductive type|inductive type]]s used in type theory.
A second version of the APL array model was developed in order to more transparently handle nested data, without the need to explicitly box and unbox arrays. The Nested Array Research System ([[NARS]]) was developed to study this model. In it, arrays contain other arrays directly. In this way they resemble the [[wikipedia:inductive type|inductive type]]s used in type theory.
 
{| class=wikitable style="float:right"
|{{quote | "An array is a rectangular collection of numbers, characters and arrays, arranged along zero or more axes."|[[John Scholes]]}}
|}
In nested APLs each individual number or character is encapsulated in a [[simple scalar]]. Such a scalar may be referred to as "a number" or "a character" but it maintains the properties of an array. Other arrays used by the language are defined inductively: an array can be formed which contains as elements any array which has already been defined. Such an array cannot, by the nature of inductive definition, contain itself, even within many levels of nesting inside it. Arrays which contain only simple scalars, or are themselves simple scalars, are called [[Simple array|simple]]. Non-simple arrays are called "nested". The simple arrays are a superset of the arrays allowed in flat array theory without boxes: they include all arrays of numbers and characters, as well as arrays which mix numbers and characters. Arrays which would not be representable in flat array theory—those which contain a mixture of simple scalar types, or contain both simple scalars and other arrays—are called [[Mixed array|mixed]].
In nested APLs each individual number or character is encapsulated in a [[simple scalar]]. Such a scalar may be referred to as "a number" or "a character" but it maintains the properties of an array. Other arrays used by the language are defined inductively: an array can be formed which contains as elements any array which has already been defined. Such an array cannot, by the nature of inductive definition, contain itself, even within many levels of nesting inside it. Arrays which contain only simple scalars, or are themselves simple scalars, are called [[Simple array|simple]]. Non-simple arrays are called "nested". The simple arrays are a superset of the arrays allowed in flat array theory without boxes: they include all arrays of numbers and characters, as well as arrays which mix numbers and characters. Arrays which would not be representable in flat array theory—those which contain a mixture of simple scalar types, or contain both simple scalars and other arrays—are called [[Mixed array|mixed]].


Navigation menu