Pair

From APL Wiki
Jump to navigation Jump to search

Pair () is a primitive function equivalent to the dfn {,⊂ } which aids in constructing nested arrays during tacit programming where stranding by juxtaposition is not available. It is also equivalent to , using the Over operator or ,⍨∘⍨∘ using only traditional operators. It was introduced in Extended Dyalog APL, and then adopted into dzaima/APL.

Common usage

Its plain usage is in pairing up two parallel values:

Try it online!

      6 7 8(+-)3
┌───────┬─────┐
9 10 113 4 5
└───────┴─────┘

It can also be combined with Mix to increase rank rather than depth:

Try it online!

      6 7 8(+↑-)3
9 10 11
3  4  5


APL built-ins [edit]
Primitive functions
Scalar
Monadic ConjugateNegateSignumNotRollType
Dyadic AddSubtractEqual to (Xnor) ∙ Not Equal to (Xor) ∙ MinimumMaximumComparison functions
Non-Scalar
Structural ShapeReshapeTallyDepthRavelReverseRazeMixCut (K)PairReplicatePartitioned Enclose
Selection TakeDropUniqueIdentitySelect
Selector Index generatorInterval IndexIndices
Computational MatchNot MatchNub SieveFormatExecute
Primitive operators Monadic EachReplicate
Dyadic Reverse Compose
Quad names
Arrays Index originMigration level
Functions
Operators
Other ZildeHigh minusFunction axis