Singleton: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
No edit summary
m (Kinds of array category)
Line 12: Line 12:


Singletons may be subject to [[singleton extension]].
Singletons may be subject to [[singleton extension]].
{{APL features}}
{{APL features}}[[Category:Kinds of array]]

Revision as of 14:59, 30 April 2020

A singleton is an array with bound 1. Equivalently, its shape consists entirely of 1s. It may have any rank. For example, all the following are singletons:

Whether an array X is a singleton can be determined with 1/X or, less efficiently, with 1=≢,X.

Every scalar X is a singleton, because 1/X, or alternatively 1=≢,X.

Singletons may be subject to singleton extension.

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 floorTotal array orderingTacit programming (Function composition, Close composition) ∙ Glyph
Errors LIMIT ERRORRANK ERRORSYNTAX ERRORDOMAIN ERRORLENGTH ERRORINDEX ERRORVALUE ERROR