Catenate: Difference between revisions

Jump to navigation Jump to search
493 bytes added ,  21:02, 10 September 2022
m
Text replacement - "</source>" to "</syntaxhighlight>"
m (First/last axis forms category)
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Built-ins|Catenate|,|⍪}} is a [[Primitive function|primitive]] [[dyadic function]] that combines two arrays along a shared [[axis]], so that [[element]]s of the left argument are followed by those of the right along that axis. This axis can already exist or can be created by inserting a length-1 axis (for example, to append a column to a [[matrix]]), but to catenate arrays, at least one argument must have the axis already. The operation that combines two arrays of [[match]]ing [[shape]] along a completely new axis, which will then have length 2, is called [[Laminate]]. In all APLs, catenating two [[scalar]]s is allowed and actually performs a lamination. In APLs which allow a [[function axis]] for Catenate, Laminate can be invoked by giving a fractional (non-integer) axis.
{{Built-ins|Catenate|,|⍪}} is a [[Primitive function|primitive]] [[dyadic function]] that combines two arrays along a shared [[axis]], so that [[element]]s of the left argument are followed by those of the right along that axis. This axis can already exist or can be created by inserting a length-1 axis (for example, to append a column to a [[matrix]]), but to catenate arrays, at least one argument must have the axis already. The operation that combines two arrays of [[match]]ing [[shape]] along a completely new axis, which will then have length 2, is called [[Laminate]]. In all APLs, catenating two [[scalar]]s is allowed and actually performs a lamination. In APLs which allow a [[function axis]] for Catenate, Laminate can be invoked by giving a fractional (non-integer) axis.


In most APLs, Catenate (<source lang=apl inline>,</source>) defaults to using the last axis if none is specified. Catenate First (<source lang=apl inline>⍪</source>), introduced by [[NARS]], defaults to the first axis instead. Array languages based on [[leading axis theory]], such as [[A+]] and [[J]], simplify Catenate by using only the first-axis form (with the glyph <source lang=apl inline>,</source>) and removing the ability to specify an axis, and add a new dedicated [[Laminate]] function.
In most APLs, Catenate (<syntaxhighlight lang=apl inline>,</syntaxhighlight>) defaults to using the last axis if none is specified. Catenate First (<syntaxhighlight lang=apl inline>⍪</syntaxhighlight>), introduced by [[NARS]], defaults to the first axis instead. Array languages based on [[leading axis theory]], such as [[A+]] and [[J]], simplify Catenate by using only the first-axis form (with the glyph <syntaxhighlight lang=apl inline>,</syntaxhighlight>) and removing the ability to specify an axis, and add a new dedicated [[Laminate]] function.


== Prototype choice ==
== Prototype choice ==
Line 17: Line 17:
| [[J]]                                                                    || type hierarchy
| [[J]]                                                                    || type hierarchy
|}
|}
== See also ==
* [[Pair]]
* [[Strand notation]]
== External links ==
=== Tutorial ===
* [https://chat.stackexchange.com/rooms/52405/conversation/lesson-9-apl-functions---#41726726 APL Cultivation]
=== Documentation ===
* [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Catenate%20Laminate.htm Dyalog]
* [http://microapl.com/apl_help/ch_020_020_490.htm APLX]
* [https://mlochbaum.github.io/BQN/doc/join.html#join-to BQN]


== References ==
== References ==

Navigation menu