Commute

From APL Wiki
Jump to navigation Jump to search

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


APL built-ins [edit]
Primitive functions
Scalar
Monadic ConjugateNegateSignumNotRollType
Dyadic AddSubtractTimesDivideEqual to (Xnor) ∙ Not Equal to (Xor) ∙ MinimumMaximumComparison functionsComplex
Non-Scalar
Structural ShapeReshapeTallyDepthRavelReverseRazeMixCut (K)PairReplicatePartitioned Enclose
Selection FirstTakeDropUniqueIdentitySelectBracket index
Selector Index generatorInterval IndexIndices
Computational MatchNot MatchNub SieveFormatExecute
Primitive operators Monadic EachReplicateCommuteFunction axis
Dyadic BesideBindReverse Compose
Quad names
Arrays Index originMigration level
Functions
Operators