Element

From APL Wiki
Revision as of 09:43, 18 October 2019 by Miraheze>Marshall (Created page with "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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 atom 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.