Total array ordering
- TAO links here. For the chat room, see The APL Orchard.
Total array ordering, or TAO, is the array ordering defined by Dyalog APL in version 17.0 (2018), which pertains to arrays of nulls, numbers, and characters in any arrangement. It extends the concept of lexicographic order to higher ranks. The name total array ordering is taken partly from the mathematical concept of a total order, which must order any two values, with values ordering equally only if they are identical. This concept is transferred to APL by specifying that arrays should only order equally if they match. The name has also been applied retroactively to J's array ordering, which has different rules from Dyalog,[1] and is used in TinyAPL, which bases its ordering on Dyalog's but treats scalars differently.
The extensions made in Dyalog 17.0 are support for complex numbers and the special value ⎕null
, the ability to compare values of different types, and the extension to differing shapes and ranks. There is no support for simple scalars other than nulls, numbers or characters (namely namespaces, objects, and object representations), because ordering those was considered "contentious but of little incremental benefit."[2] Roger Hui has argued that these scalars are not truly arrays, and are not in the scope of a total array ordering. However, the dfns workspace includes an APL model which is truly total, though it differs from the native implementation in ordering characters before numbers instead of the opposite.[3]
References
- ↑ Hui, R.. The TAO of J.
- ↑ Brudzewsky, A., J. Foad, and R. Hui. TAO Axioms. 2018-02-02.
- ↑ Dfns workspace.
le
― Total array ordering (TAO) comparison.
APL features [edit] | |
---|---|
Built-ins | Primitives (functions, operators) ∙ Quad name |
Array model | Shape ∙ Rank ∙ Depth ∙ Bound ∙ Index (Indexing) ∙ Axis ∙ Ravel ∙ Ravel order ∙ Element ∙ Scalar ∙ Vector ∙ Matrix ∙ Simple scalar ∙ Simple array ∙ Nested array ∙ Cell ∙ Major cell ∙ Subarray ∙ Empty array ∙ Prototype |
Data types | Number (Boolean, Complex number) ∙ Character (String) ∙ Box ∙ Namespace ∙ Function array |
Concepts and paradigms | Conformability (Scalar extension, Leading axis agreement) ∙ Scalar function (Pervasion) ∙ Identity element ∙ Complex floor ∙ Array ordering (Total) ∙ Tacit programming (Function composition, Close composition) ∙ Glyph ∙ Leading axis theory ∙ Major cell search ∙ First-class function |
Errors | LIMIT ERROR ∙ RANK ERROR ∙ SYNTAX ERROR ∙ DOMAIN ERROR ∙ LENGTH ERROR ∙ INDEX ERROR ∙ VALUE ERROR ∙ EVOLUTION ERROR |