Operator

From APL Wiki
Revision as of 15:45, 13 March 2020 by Marshall (talk | contribs) (Created page with "In APL syntax, an '''operator''' applies to function or array operands to yield a derived function result. Operators bind with higher precedence than f...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In APL syntax, an operator applies to function or array operands to yield a derived function result. Operators bind with higher precedence than functions and are grouped from left to right, the opposite of APL's right to left evaluation order for functions. In most cases operators cannot themselves be modified, but reductions and scans do take a specified axis, and in some APLs hyperators can take operator hyperands.

Operators may be primitive operators, system operators, or defined operators. In some APLs it is also possible to produce a derived operator by passing only one operand to a dyadic operator.

An operator's valence indicates the number of operands it takes:

Unlike with monadic and dyadic functions, an operator's valence is an intrinsic property and must be known in order to parse an APL expression containing it. Also unlike functions, there is no such thing as a "niladic operator" taking no operands, because this would be indistinguishable from a niladic function.