Close composition: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Created page with "In SHARP APL and J, a '''close composition''' is one of the operators Atop (operator), Over, or Under, defined so that the overall result has functi...")
 
(add modern column and syntax colouring)
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 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. 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
! Operator !! SHARP !! J close !! J non-close !! Modern
|-
|-
| [[Atop (operator)|Atop]] || <code>⍥</code> || <code>@</code>  || <code>@:</code>
| [[Atop (operator)|Atop]] || <source lang=apl inline>⍥</source> || <source lang=j inline>@</source>  || <source lang=j inline>@:</source> || <source lang=apl inline>⍤</source>
|-
|-
| [[Over]]                || <code>⍤</code> || <code>&</code>  || <code>&:</code>
| [[Over]]                || <source lang=apl inline>⍤</source> || <source lang=j inline>&</source>  || <source lang=j inline>&:</source> || <source lang=apl inline>⍥</source>
|-
|-
| [[Under]]                || <code>¨</code> || <code>&.</code> || <code>&.:</code>
| [[Under]]                || <source lang=apl inline>¨</source> || <source lang=j inline>&.</source> || <source lang=j inline>&.:</source> || <source lang=apl inline>⍢</source>
|}
|}


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

Revision as of 08:06, 26 April 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 built-ins [edit]
Primitives (Timeline) Functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare RootRound
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentityStopSelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndexCartesian ProductSort
Selector Index generatorGradeIndex OfInterval IndexIndicesDealPrefix and suffix vectors
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-BeamSpawnFunction axisIdentity (Null, Ident)
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductDeterminantPowerAtUnderRankDepthVariantStencilCutDirect definition (operator)Identity (Lev, Dex)
Quad names Index originComparison toleranceMigration levelAtomic vector