4,494
edits
m (Text replacement - "</source>" to "</syntaxhighlight>") |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
Line 2: | Line 2: | ||
Consider for example applying a [[Windowed Reduction]] to an array: | Consider for example applying a [[Windowed Reduction]] to an array: | ||
< | <syntaxhighlight lang=apl> | ||
3 ⌈/ 2 9 0 ¯1 0 2 5 | 3 ⌈/ 2 9 0 ¯1 0 2 5 | ||
9 9 0 2 5 | 9 9 0 2 5 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
In this statement the [[Reduce]] operator (< | In this statement the [[Reduce]] operator (<syntaxhighlight lang=apl inline>/</syntaxhighlight>) is applied to the [[Minimum]] function (<syntaxhighlight lang=apl inline>⌈</syntaxhighlight>) resulting in the derived function <syntaxhighlight lang=apl inline>⌈/</syntaxhighlight>. In most modern APLs this function can be manipulated like any other function, for example to [[assign]] it to a name: | ||
< | <syntaxhighlight lang=apl> | ||
f ← ⌈/ | f ← ⌈/ | ||
3 f 2 9 0 ¯1 0 2 5 | 3 f 2 9 0 ¯1 0 2 5 | ||
9 9 0 2 5 | 9 9 0 2 5 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Here the value of < | Here the value of <syntaxhighlight lang=apl inline>f</syntaxhighlight> is a derived function. Many APLs display a derived function by placing its operands next to the operator, as it is written: | ||
< | <syntaxhighlight lang=apl> | ||
f | f | ||
⌈/ | ⌈/ |