Identity: Difference between revisions

Jump to navigation Jump to search
213 bytes added ,  02:48, 17 July 2021
No edit summary
(→‎Documentation: BQN link)
(4 intermediate revisions by 3 users not shown)
Line 2: Line 2:
|<code>⊣</code> <code>⊢</code>
|<code>⊣</code> <code>⊢</code>
|}
|}
:''This page is about the class of primitive functions. For the result of an empty reduction, see [[Identity element]].''
An '''Identity function''', or '''tack function''', is one of the three [[primitive function]]s which returns one of its [[argument]]s with no modification:
An '''Identity function''', or '''tack function''', is one of the three [[primitive function]]s which returns one of its [[argument]]s with no modification:
* '''Identity''', '''Same''', or '''Pass''' (<source lang=apl inline>⊣</source> or <source lang=apl inline>⊢</source>) is [[monadic]] and returns its only argument.
* '''Identity''', '''Same''', or '''Pass''' (<source lang=apl inline>⊣</source> or <source lang=apl inline>⊢</source>) is [[monadic]] and returns its only argument.
Line 32: Line 33:
== Uses ==
== Uses ==


As the left [[operand]] to [[Compose]], Right makes the resulting [[derived function]] ignore its left argument (so the result is produced by a [[monadic]] invocation of the right operand, on the right argument). The same pattern can be produced by using Right as the right operand to [[Atop]].
As the left [[operand]] to [[Beside]], Right makes the resulting [[derived function]] ignore its left argument (so the result is produced by a [[monadic]] invocation of the right operand, on the right argument). The same pattern can be produced by using Right as the right operand to [[Atop]].
<source lang=apl>
<source lang=apl>
       2 ⊢∘- 7
       2 ⊢∘- 7
Line 46: Line 47:
¯7
¯7
</source>
</source>
The mirror image—using only the left argument while ignoring the left—is attained by using [[Atop]] (either the operator, or a 2-train) with Left as the right operand.
The mirror image—using only the left argument while ignoring the right—is attained by using [[Atop]] (either the operator, or a 2-train) with Left as the right operand.
<source lang=apl>
<source lang=apl>
       2 -⍤⊣ 7
       2 -⍤⊣ 7
Line 118: Line 119:
1 2 3 4 5 6
1 2 3 4 5 6
</source>
</source>
== External links ==
== External links ==


Line 125: Line 127:
* Dyalog: [https://help.dyalog.com/17.1/Content/Language/Symbols/Left%20Tack.htm Left Tack], [https://help.dyalog.com/17.1/Content/Language/Symbols/Right%20Tack.htm Right Tack]
* Dyalog: [https://help.dyalog.com/17.1/Content/Language/Symbols/Left%20Tack.htm Left Tack], [https://help.dyalog.com/17.1/Content/Language/Symbols/Right%20Tack.htm Right Tack]
* APLX: [http://microapl.com/apl_help/ch_020_020_754.htm Left], [http://microapl.com/apl_help/ch_020_020_756.htm Right], [http://microapl.com/apl_help/ch_020_020_755.htm Pass]
* APLX: [http://microapl.com/apl_help/ch_020_020_754.htm Left], [http://microapl.com/apl_help/ch_020_020_756.htm Right], [http://microapl.com/apl_help/ch_020_020_755.htm Pass]
* [https://mlochbaum.github.io/BQN/doc/identity.html BQN]


{{APL built-ins}}
{{APL built-ins}}[[Category:Primitive functions]]

Navigation menu