4,494
edits
m (Text replacement - "</source>" to "</syntaxhighlight>") |
|||
(3 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 (< | 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 27: | Line 27: | ||
=== Documentation === | === Documentation === | ||
* [ | * [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Catenate%20Laminate.htm Dyalog] | ||
* [http://microapl.com/apl_help/ch_020_020_490.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_490.htm APLX] | ||
* [https://mlochbaum.github.io/BQN/doc/join.html#join-to BQN] | |||
== References == | == References == | ||
<references/> | <references/> | ||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Functions with first- and last-axis forms]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Functions with first- and last-axis forms]] |