Mixed array

From APL Wiki
Jump to navigation Jump to search

In nested array theory, a mixed array is one that mixes simple scalar characters and numbers, or simple scalars with arrays which are not simple scalars. Such an array cannot be formed in flat array theory, which does not allow mixing of the character, number, and boxed types.

Because it must have more than one element, a mixed array must have bound greater than one, and depth at least one (in particular, it cannot be a simple scalar). However, mixed arrays with depth one can be formed by mixing numbers and characters. While such an array is simple, it is neither a simple numeric nor a simple character array. In some cases it may be referred to as a pointer array, because it is stored using pointers like a nested array.

A non-simple mixed array must contain some simple scalars and some other arrays. As a consequence, it has depth greater than one, but some of its elements have depth zero. Therefore its signed depth is negative.

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