Conformability

From APL Wiki
Revision as of 09:36, 21 November 2019 by RichPark (talk | contribs) (1 revision imported)
Jump to navigation Jump to search

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