Conformability
Revision as of 23:36, 16 November 2019 by Miraheze>Adám Brudzewsky (Text replacement - "{{APL programming language}}" to "{{APL features}}")
Conformability describes the conditions that must be satisfied by arguments to dyadic scalar functions. The arguments must match in shape, taking into account scalar extension and, when it is supported, singleton extension. The criteria which determine the result shape are often considered part of conformability as well. Some functionality, such as multiple assignment, might use modified conformability rules.
Two arguments are said to conform when either
- They have identical shapes, or
- One of them is extendible (it is a scalar, or, in languages with singleton extension, has exacly one element).
The result shape associated with such arguments can then be determined:
- If the shapes matched, it is that shape
- If exactly one argument was extended, it is the other argument's shape
- Otherwise, it is the shape of the argument with the largest rank (this condition is only possible with singleton extension).
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 |