Pair: Difference between revisions
Jump to navigation
Jump to search
m (Link to Over correctly) 

Line 1:  Line 1:  
{{BuiltinPair⍮}} or '''Juxtapose''' is a [[primitive function]] equivalent to the [[dfn]] <source lang=apl inline>{⍺←,⊂ ⋄ ⍺ ⍵}</source> which aids in constructing nested arrays during [[tacit programming]] where [[stranding]] by juxtaposition is not available. It is also equivalent to the [[catenatecatenation]] of the [[enclose]]d arguments; <source lang=apl inline>,⍥⊂</source> using the [[Over operator]] or <source lang=apl inline>,⍨∘⊂⍨∘⊂</source> using only the traditional operators [[Commute]] and [[Compose]]. It was introduced in [[Extended Dyalog APL]], and then adopted into [[dzaima/APL]].  {{BuiltinPair⍮}} or '''Juxtapose''' is a [[primitive function]] equivalent to the [[dfn]] <source lang=apl inline>{⍺←,⊂ ⋄ ⍺ ⍵}</source> which aids in constructing nested arrays during [[tacit programming]] where [[stranding]] by juxtaposition is not available. It is also equivalent to the [[catenatecatenation]] of the [[enclose]]d arguments; <source lang=apl inline>,⍥⊂</source> using the [[Over]] [[operator]] or <source lang=apl inline>,⍨∘⊂⍨∘⊂</source> using only the traditional operators [[Commute]] and [[Compose]]. It was introduced in [[Extended Dyalog APL]], and then adopted into [[dzaima/APL]].  
== Common usage ==  == Common usage == 
Revision as of 17:22, 19 April 2022
⍮

Pair (⍮
) or Juxtapose 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 the catenation of the enclosed arguments; ,⍥⊂
using the Over operator or ,⍨∘⊂⍨∘⊂
using only the traditional operators Commute and Compose. 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:
6 7 8(+⍮)3
┌───────┬─────┐
│9 10 11│3 4 5│
└───────┴─────┘
Works in: dzaima/APL, Extended Dyalog APL
It can also be combined with Mix to increase rank rather than depth:
6 7 8(+↑⍤⍮)3
9 10 11
3 4 5
Works in: dzaima/APL, Extended Dyalog APL