Element: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
Miraheze>Adám Brudzewsky
No edit summary
m (Array relationships category)
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
In the APL [[array model]], an element of an array is one of the values it contains. In [[flat array theory]] an element is a [[character]], [[number]], or [[box]], and cannot be manipulated directly within the language. In [[nested array theory]] each element of an array is another array, and an element of an array can be retrieved using the [[Pick]] function. [[Stranding]] forms a [[vector]] directly from its elements.
In the APL [[array model]], an '''element''' of an array is one of the values it contains. In [[flat array theory]] an element is a [[character]], [[number]], or [[box]], and cannot be manipulated directly within the language. In [[nested array theory]] each element of an array is another array, and an element of an array can be retrieved using the [[Pick]] function. [[Stranding]] forms a [[vector]] directly from its elements.


The APL Wiki's usage of the term "element" differs from the usage in flat array languages, where it may be used as a synonym for an atom or 0-[[cell]] or to refer to the contents of [[box]] elements in a boxed array. Defining "element" to mean something that is not an array is intended to make it easier to reconcile flat with nested array theory using common terminology.
The APL Wiki's usage of the term "element" differs from the usage in flat array languages, where it may be used as a synonym for an atom or 0-[[cell]] or to refer to the contents of [[box]] elements in a boxed array. Defining "element" to mean something that is not an array is intended to make it easier to reconcile flat with nested array theory using common terminology.


[[Scalar functions]] are applied element-wise to their argument arrays (using [[conformability]] to pair elements). In nested APLs this means they traverse deeply nested arrays to produce a result; in flat APLs they go down only one level.
[[Scalar function]]s are applied element-wise to their argument arrays (using [[conformability]] to pair elements). In nested APLs this means they traverse deeply nested arrays to produce a result; in flat APLs they go down only one level.
{{APL programming language}}
{{APL features}}[[Category:Array relationships]]

Revision as of 14:11, 30 April 2020

In the APL array model, an element of an array is one of the values it contains. In flat array theory an element is a character, number, or box, and cannot be manipulated directly within the language. In nested array theory each element of an array is another array, and an element of an array can be retrieved using the Pick function. Stranding forms a vector directly from its elements.

The APL Wiki's usage of the term "element" differs from the usage in flat array languages, where it may be used as a synonym for an atom or 0-cell or to refer to the contents of box elements in a boxed array. Defining "element" to mean something that is not an array is intended to make it easier to reconcile flat with nested array theory using common terminology.

Scalar functions are applied element-wise to their argument arrays (using conformability to pair elements). In nested APLs this means they traverse deeply nested arrays to produce a result; in flat APLs they go down only one level.

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 search
Errors LIMIT ERRORRANK ERRORSYNTAX ERRORDOMAIN ERRORLENGTH ERRORINDEX ERRORVALUE ERROREVOLUTION ERROR