Catenate: Difference between revisions

Jump to navigation Jump to search
27 bytes added ,  20:58, 10 September 2022
m
Text replacement - "<source" to "<syntaxhighlight"
m (Text replacement - "<source" to "<syntaxhighlight")
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>,</source>) defaults to using the last axis if none is specified. Catenate First (<syntaxhighlight 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 <syntaxhighlight lang=apl inline>,</source>) and removing the ability to specify an axis, and add a new dedicated [[Laminate]] function.


== Prototype choice ==
== Prototype choice ==

Navigation menu