Function axis: Difference between revisions
Jump to navigation
Jump to search
Remove name "Bracket Axis" and explain derived functions with axis
Miraheze>Marshall m (Marshall moved page Bracket axis to Function axis over redirect: Eh, axis applies to the derived function (even if it was initially attached to an operator). We should name things after the functionality and not the syntax unless there is a really strong reason to do so.) |
Miraheze>Marshall (Remove name "Bracket Axis" and explain derived functions with axis) |
||
Line 1: | Line 1: | ||
{{Built-in| | {{Built-in|Function axis|[ax]}} is a special syntax which modifies the behavior of a function, for example <source lang=apl inline>⌽[2]</source> to [[Rotate]] along the second [[axis]]. Axis specification was a feature of [[Iverson notation]] and was ubiquitous in early APLs; many newer APLs which adhere to [[leading axis theory]] reject the use of axis specification in favor of the [[Rank operator]] because it is a fully general operator while the behavior of functions with axis must be defined for each function separately. | ||
== Functions == | == Functions == | ||
Line 24: | Line 24: | ||
* [[Scan]] works on the specified right argument axis. | * [[Scan]] works on the specified right argument axis. | ||
In [[Dyalog APL]], a slash with axis retains its [[function-operator overloading]]: it can be applied as an operator or as a dyadic function ([[Replicate]] or [[Expand]]). | In [[SHARP APL]], [[Replicate]] and [[Expand]] are also included in this category as they are operators and not functions. | ||
Axis specification always modifies the [[derived function]] obtained from an operator, and not the operator itself. The exact syntax may vary: in most cases a set of brackets is parsed like a monadic operator and applies directly to the derived function; sometimes brackets can be applied directly to an operator, in which case the derived function produced by this operator is modified. In [[Dyalog APL]], a slash with axis retains its [[function-operator overloading]]: it can be applied as an operator or as a dyadic function ([[Replicate]] or [[Expand]]). | |||
== External links == | == External links == |