Pair: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Built-in|Pair|⍮}} is a primitive function equivalent to the dfn <source lang=apl inline>{⍺←,⊂ ⋄ ⍺ ⍵}</source> which aids in constructing nested arrays...") |
|||
Line 13: | Line 13: | ||
{{Works in|[[dzaima/APL]], [[Extended Dyalog APL]]}} | {{Works in|[[dzaima/APL]], [[Extended Dyalog APL]]}} | ||
It can also be combined with [[Mix]] to increase rank rather than depth: | It can also be combined with [[Mix]] to increase [[rank]] rather than [[depth]]: | ||
[https://tio.run/##SyzI0U2pSszMTfz//1Hf1EdtE8wUzBUsNLQftU181LvkUe86XU3j//8B Try it online!] | [https://tio.run/##SyzI0U2pSszMTfz//1Hf1EdtE8wUzBUsNLQftU181LvkUe86XU3j//8B Try it online!] |
Revision as of 09:59, 12 February 2020
⍮
|
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:
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