A fill element is an element used for the result of a function when no element from the argument or another relevant array is used. The fill element is usually that array's prototype. J allows the fill to be specified using the fit conjunction
!., an analogue of Variant.
Fills are one way to convert an empty array into a non-empty array. Reduction along an empty axis also produces such a transition, but in this case an identity element for the reducing function is used instead of a fill.
The following functions and operators may use fill elements in their results.
Each operator in the table uses fills to force the results from its left operand to have a common shape—in one nested interpretation, they call Mix on an array with those results as elements. The fills for each result are taken from that result's prototype.
In languages with function rank, fills are similarly used to force result cells of a function with rank to have a uniform shape. This means that fills may be used by any primitive function which can produce differently-shaped result cells in a single application. A notable example is Unbox, which behaves like the nested Mix because of this feature of function rank.
|APL features |
|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 ∙ Total array ordering ∙ Tacit programming (Function composition, Close composition) ∙ Glyph|
|Errors||LIMIT ERROR ∙ RANK ERROR ∙ SYNTAX ERROR ∙ DOMAIN ERROR ∙ LENGTH ERROR ∙ INDEX ERROR ∙ VALUE ERROR|