Close composition: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<source" to "<syntaxhighlight")
Line 4: Line 4:
! Operator !! SHARP !! J close !! J non-close !! Modern
! Operator !! SHARP !! J close !! J non-close !! Modern
|-
|-
| [[Atop (operator)|Atop]] || <source lang=apl inline>⍥</source> || <source lang=j inline>@</source>  || <source lang=j inline>@:</source> || <source lang=apl inline>⍤</source>
| [[Atop (operator)|Atop]] || <syntaxhighlight lang=apl inline>⍥</source> || <syntaxhighlight lang=j inline>@</source>  || <syntaxhighlight lang=j inline>@:</source> || <syntaxhighlight lang=apl inline>⍤</source>
|-
|-
| [[Over]]                || <source lang=apl inline>⍤</source> || <source lang=j inline>&</source>  || <source lang=j inline>&:</source> || <source lang=apl inline>⍥</source>
| [[Over]]                || <syntaxhighlight lang=apl inline>⍤</source> || <syntaxhighlight lang=j inline>&</source>  || <syntaxhighlight lang=j inline>&:</source> || <syntaxhighlight lang=apl inline>⍥</source>
|-
|-
| [[Under]]                || <source lang=apl inline>¨</source> || <source lang=j inline>&.</source> || <source lang=j inline>&.:</source> || <source lang=apl inline>⍢</source>
| [[Under]]                || <syntaxhighlight lang=apl inline>¨</source> || <syntaxhighlight lang=j inline>&.</source> || <syntaxhighlight lang=j inline>&.:</source> || <syntaxhighlight lang=apl inline>⍢</source>
|}
|}


{{APL features}}[[Category:Composition operators]]
{{APL features}}[[Category:Composition operators]]

Revision as of 22:18, 10 September 2022

In SHARP APL and J, a close composition is one of the operators Atop, Over, or Under, defined so that the overall result has function rank equal to the right operand. In SHARP all composition operators follow this pattern, while in J, both close and non-close forms (with a result rank of infinity, matching the definition in most modern APLs) are provided.

Operator SHARP J close J non-close Modern
Atop <syntaxhighlight lang=apl inline>⍥</source> <syntaxhighlight lang=j inline>@</source> <syntaxhighlight lang=j inline>@:</source> <syntaxhighlight lang=apl inline>⍤</source>
Over <syntaxhighlight lang=apl inline>⍤</source> <syntaxhighlight lang=j inline>&</source> <syntaxhighlight lang=j inline>&:</source> <syntaxhighlight lang=apl inline>⍥</source>
Under <syntaxhighlight lang=apl inline>¨</source> <syntaxhighlight lang=j inline>&.</source> <syntaxhighlight lang=j inline>&.:</source> <syntaxhighlight lang=apl inline>⍢</source>


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