Close composition: Difference between revisions
Jump to navigation
Jump to search
(add modern column and syntax colouring) |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(2 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
! Operator !! SHARP !! J close !! J non-close !! Modern | ! Operator !! SHARP !! J close !! J non-close !! Modern | ||
|- | |- | ||
| [[Atop (operator)|Atop]] || < | | [[Atop (operator)|Atop]] || <syntaxhighlight lang=apl inline>⍥</syntaxhighlight> || <syntaxhighlight lang=j inline>@</syntaxhighlight> || <syntaxhighlight lang=j inline>@:</syntaxhighlight> || <syntaxhighlight lang=apl inline>⍤</syntaxhighlight> | ||
|- | |- | ||
| [[Over]] || < | | [[Over]] || <syntaxhighlight lang=apl inline>⍤</syntaxhighlight> || <syntaxhighlight lang=j inline>&</syntaxhighlight> || <syntaxhighlight lang=j inline>&:</syntaxhighlight> || <syntaxhighlight lang=apl inline>⍥</syntaxhighlight> | ||
|- | |- | ||
| [[Under]] || < | | [[Under]] || <syntaxhighlight lang=apl inline>¨</syntaxhighlight> || <syntaxhighlight lang=j inline>&.</syntaxhighlight> || <syntaxhighlight lang=j inline>&.:</syntaxhighlight> || <syntaxhighlight lang=apl inline>⍢</syntaxhighlight> | ||
|} | |} | ||
{{APL | {{APL features}}[[Category:Composition operators]] |
Revision as of 22:26, 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 | ⍥ |
@ |
@: |
⍤
|
Over | ⍤ |
& |
&: |
⍥
|
Under | ¨ |
&. |
&.: |
⍢
|
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 ∙ 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 |