Commute: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Built-in|Commute|⍨}} is a | {{Built-in|Commute|⍨}} is a [[monadic operator]] that takes a [[[dyadic function]] as operand and modifies how the argument(s) of its derived functions are used. If the derived function is used monadically, the argument is also used as left argument. This usage is also known as '''Self''' or, more informally, '''Selfie'''. If the derived function is used dyadically, the arguments are swapped. This usage is also known as '''Swap'''. | ||
== Examples == | == Examples == | ||
This decrements from the vector: | |||
<source lang=apl> | <source lang=apl> | ||
1 -⍨ 1 2 3 | 1 -⍨ 1 2 3 | ||
0 1 2 | |||
</source> | </source> | ||
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[NARS2000]]}} | |||
Double: | |||
<source lang=apl> | |||
+⍨1 2 3 | |||
2 4 6 | |||
</source> | |||
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[NARS2000]]}} | |||
== External links == | == External links == | ||
Line 12: | Line 20: | ||
=== Lessons === | === Lessons === | ||
* [https://chat.stackexchange.com/ | * [https://chat.stackexchange.com/rooms/52405/conversation/lesson-3-some-apl-operators-----#40900200] | ||
=== Documentation === | === Documentation === |
Revision as of 15:04, 26 April 2020
⍨
|
Commute (⍨
) is a monadic operator that takes a [[[dyadic function]] as operand and modifies how the argument(s) of its derived functions are used. If the derived function is used monadically, the argument is also used as left argument. This usage is also known as Self or, more informally, Selfie. If the derived function is used dyadically, the arguments are swapped. This usage is also known as Swap.
Examples
This decrements from the vector:
1 -⍨ 1 2 3 0 1 2
Double:
+⍨1 2 3 2 4 6
External links
Lessons
Documentation