Close composition: Difference between revisions

Jump to navigation Jump to search
965 bytes added ,  02:12, 27 August 2023
m
no edit summary
(add modern column and syntax colouring)
mNo edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
In [[SHARP APL]] and [[J]], a '''close composition''' is one of the [[operator]]s [[Atop (operator)|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.
In [[SHARP APL]] and [[J]], a '''close composition''' is one of the [[operator]]s [[Atop (operator)|Atop]], [[Over]], or [[Under]], defined so that the overall result has [[function rank]] equal to the right [[operand]]. "Close" is meant in the sense of distance; the left operand is applied nearer to the right operand relative to the corresponding rankless composition, in the sense that it is immediately applied to the result of each individual application of the right operand, as opposed to after the [[assembly]] of the right-operand results.<ref>[[Ken Iverson|K.E. Iverson]]. [https://www.jsoftware.com/papers/opfns1.htm#8 Operators and Functions. §8 ''Composition and Duality''.] Research Report RC-7091. [[IBM]] Watson Research Center. 1978-04-26.</ref><ref>[[Ken Iverson|K.E. Iverson]]. [https://www.jsoftware.com/papers/RationalizedAPL1.htm#i Rationalized APL. §I. ''New Operators'']. Research Report 1. [[I.P. Sharp Associates]]. 1983-04-04.</ref> 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.


{|class=wikitable
{|class=wikitable
! Operator !! SHARP !! J close !! J non-close !! Modern
! Operator !! SHARP !! J close !! J non-close !! Modern APL
|-
|-
| [[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>⍥</syntaxhighlight> || <syntaxhighlight lang=j inline>@</syntaxhighlight>  || <syntaxhighlight lang=j inline>@:</syntaxhighlight> || <syntaxhighlight lang=apl inline>⍤</syntaxhighlight>
|-
|-
| [[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>⍤</syntaxhighlight> || <syntaxhighlight lang=j inline>&</syntaxhighlight>  || <syntaxhighlight lang=j inline>&:</syntaxhighlight> || <syntaxhighlight lang=apl inline>⍥</syntaxhighlight>
|-
|-
| [[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>¨</syntaxhighlight> || <syntaxhighlight lang=j inline>&.</syntaxhighlight> || <syntaxhighlight lang=j inline>&.:</syntaxhighlight> || <syntaxhighlight lang=apl inline>⍢</syntaxhighlight>
|}
|}


{{APL built-ins}}[[Category:Composition operators]]
{{APL features}}[[Category:Composition operators]]
trusted
83

edits

Navigation menu