2,954
edits
(Created page with "{{Built-in|Laminate|,[0.5]}} is a case of the Catenate function with axis that joins its argument arrays along a new length-2 axis. It applies whenever the function axis is non-integral, but is typically written with a half-integer axis. Possible choices of axis range from <syntaxhighlight lang=apl inline>,[⎕IO-0.5]</syntaxhighlight>, which places the new axis before any argument axis, to <syntaxhighlight lang=apl inline>,[r+⎕IO-0.5]</syntax...") |
(History) |
||
Line 1: | Line 1: | ||
{{Built-in|Laminate|,[0.5]}} is a case of the [[Catenate]] function [[function axis|with axis]] that joins its argument arrays along a new length-2 [[axis]]. It applies whenever the function axis is non-integral, but is typically written with a half-integer axis. Possible choices of axis range from <syntaxhighlight lang=apl inline>,[⎕IO-0.5]</syntaxhighlight>, which places the new axis before any argument axis, to <syntaxhighlight lang=apl inline>,[r+⎕IO-0.5]</syntaxhighlight>, where <syntaxhighlight lang=apl inline>r</syntaxhighlight> is the shared argument [[rank]], which places it after all argument axes. Laminate appears as a stand-alone function in some languages, with the name Laminate in [[A+]] (<syntaxhighlight lang=apl inline>~</syntaxhighlight>) and [[J]] (<syntaxhighlight lang=j inline>,:</syntaxhighlight>), and Couple in [[BQN]] (<code>≍</code>) and [[Uiua]] (<code>⊟</code>). These languages implement the <syntaxhighlight lang=apl inline>,[⎕IO-0.5]</syntaxhighlight> case only, as the [[Rank operator]] can be used to add the axis in a later position, in accordance with [[leading axis theory]]. | {{Built-in|Laminate|,[0.5]}} is a case of the [[Catenate]] function [[function axis|with axis]] that joins its argument arrays along a new length-2 [[axis]]. It applies whenever the function axis is non-integral, but is typically written with a half-integer axis. Possible choices of axis range from <syntaxhighlight lang=apl inline>,[⎕IO-0.5]</syntaxhighlight>, which places the new axis before any argument axis, to <syntaxhighlight lang=apl inline>,[r+⎕IO-0.5]</syntaxhighlight>, where <syntaxhighlight lang=apl inline>r</syntaxhighlight> is the shared argument [[rank]], which places it after all argument axes. Laminate appears as a stand-alone function in some languages, with the name Laminate in [[A+]] (<syntaxhighlight lang=apl inline>~</syntaxhighlight>) and [[J]] (<syntaxhighlight lang=j inline>,:</syntaxhighlight>), and Couple in [[BQN]] (<code>≍</code>) and [[Uiua]] (<code>⊟</code>). These languages implement the <syntaxhighlight lang=apl inline>,[⎕IO-0.5]</syntaxhighlight> case only, as the [[Rank operator]] can be used to add the axis in a later position, in accordance with [[leading axis theory]]. | ||
Laminate was defined as an extension to Catenate in [[APL\360]] in 1970.<ref>"Report of the APL SHARE conference" ([https://dl.acm.org/action/showBmPdf?doi=10.1145%2F987461 pdf]). [[APL Quote-Quad]] Volume 2, Number 3. 1970-09.</ref> | |||
== Examples == | == Examples == | ||
Line 63: | Line 65: | ||
* [https://www.uiua.org/docs/couple Uiua] | * [https://www.uiua.org/docs/couple Uiua] | ||
== References == | |||
<references/> | |||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Leading axis theory]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Leading axis theory]] |