Simple array: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
m (Kinds of array category)
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
In the [[nested array model]], a '''simple array''' is an array whose [[element]]s are all [[simple scalar]]s. A non-empty array is simple if and only if it has a [[depth]] of 1. [[Empty]] arrays are considered simple in most contexts, although they may have depth greater than 1 in languages that use the [[prototype]] to determine depth.
In the [[nested array model]], a '''simple''' or '''flat array''' is an array whose [[element]]s are all [[simple scalar]]s. A non-empty array is simple if and only if it has a [[depth]] of 0 (which makes it a scalar) or 1. [[Empty]] arrays are considered simple in most contexts, although they may have depth greater than 1 in languages that use the [[prototype]] to determine depth.


The simple arrays are a superset of the arrays allowed in [[flat array theory]] without [[box]]es (or those which have [[depth]] 0 in flat array theory): they include all arrays of a single type, as well as arrays which mix types like 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]].
The simple arrays are a superset of the arrays allowed in [[flat array theory]] without [[box]]es (or those which have [[depth]] 0 in flat array theory): they include all arrays of a single type, as well as arrays which mix types like 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]].


The term "simple" is not typically used in flat APLs. On the APL Wiki, it may be used to mean a non-[[box]]ed array.
The term "simple" is not typically used in flat APLs. On the APL Wiki, it may be used to mean a non-[[box]]ed array.
{{APL features}}[[Category:Kinds of array]]
{{APL features}}[[Category:Kinds of array]][[Category:Nested array model]]

Latest revision as of 10:46, 20 April 2021

In the nested array model, a simple or flat array is an array whose elements are all simple scalars. A non-empty array is simple if and only if it has a depth of 0 (which makes it a scalar) or 1. Empty arrays are considered simple in most contexts, although they may have depth greater than 1 in languages that use the prototype to determine depth.

The simple arrays are a superset of the arrays allowed in flat array theory without boxes (or those which have depth 0 in flat array theory): they include all arrays of a single type, as well as arrays which mix types like 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.

The term "simple" is not typically used in flat APLs. On the APL Wiki, it may be used to mean a non-boxed array.

APL features [edit]
Built-ins Primitives (functions, operators) ∙ Quad name
Array model ShapeRankDepthBoundIndex (Indexing) ∙ AxisRavelRavel orderElementScalarVectorMatrixSimple scalarSimple arrayNested arrayCellMajor cellSubarrayEmpty arrayPrototype
Data types Number (Boolean, Complex number) ∙ Character (String) ∙ BoxNamespaceFunction array
Concepts and paradigms Conformability (Scalar extension, Leading axis agreement) ∙ Scalar function (Pervasion) ∙ Identity elementComplex floorArray ordering (Total) ∙ Tacit programming (Function composition, Close composition) ∙ GlyphLeading axis theoryMajor cell searchFirst-class function
Errors LIMIT ERRORRANK ERRORSYNTAX ERRORDOMAIN ERRORLENGTH ERRORINDEX ERRORVALUE ERROREVOLUTION ERROR