Function rank: Difference between revisions

Jump to navigation Jump to search
14 bytes added ,  09:07, 29 October 2019
m
Text replacement - "</code>" to "</source>"
Miraheze>Adám Brudzewsky
m (Text replacement - "<code>" to "<source lang=apl inline>")
Miraheze>Adám Brudzewsky
m (Text replacement - "</code>" to "</source>")
Line 1: Line 1:
In [[SHARP APL]], [[Rationalized APL]], and [[J]], function rank refers to a built-in property of a function indicating which argument [[Rank|ranks]] it accepts. A function will be applied as though it were given that rank with the [[Rank operator]]. The function rank may also have other observable effects: in [[J]], the ranks of <source lang=apl inline>f</code> may be viewed using <source lang=apl inline>f b. 0</code> and another function <source lang=apl inline>g</code> may be given those ranks using <source lang=apl inline>g"f</code> (<source lang=apl inline>"</code> is the Rank operator). Every language with function rank defines [[Close composition|"close" composition operators]] which inherit the rank of their right operand—the [[derived function]] produced by such a composition has ranks derived from that function's ranks.
In [[SHARP APL]], [[Rationalized APL]], and [[J]], function rank refers to a built-in property of a function indicating which argument [[Rank|ranks]] it accepts. A function will be applied as though it were given that rank with the [[Rank operator]]. The function rank may also have other observable effects: in [[J]], the ranks of <source lang=apl inline>f</source> may be viewed using <source lang=apl inline>f b. 0</source> and another function <source lang=apl inline>g</source> may be given those ranks using <source lang=apl inline>g"f</source> (<source lang=apl inline>"</source> is the Rank operator). Every language with function rank defines [[Close composition|"close" composition operators]] which inherit the rank of their right operand—the [[derived function]] produced by such a composition has ranks derived from that function's ranks.


== History ==
== History ==


Function rank was first introduced without being given a name in [[SHARP APL]], as a feature of the compositions [[Over|with]] and [[Atop|over]]. New compositions such as <source lang=apl inline>f⍤g</code> were described as "close in the sense that the expression… is applied individually to each subarray argument of <source lang=apl inline>g</code>".<ref>K.E. Iverson. [https://www.jsoftware.com/papers/satn41.htm "Composition and Enclosure"]. SATN 41, 1981-06-20.</ref> The concept of function rank was formalized, and applied to most primitives, when the [[Rank operator]] was introduced to SHARP version 19.0 in 1987.<ref>Bernecky, Robert. [https://dl.acm.org/citation.cfm?id=55632 "An Introduction to Function Rank"]. APL88 Conference Proceedings. ''ACM SIGAPL Quote Quad'', 18(2), December 1987.</ref> In [[J]] every function, primitive or user-defined, has a function rank.
Function rank was first introduced without being given a name in [[SHARP APL]], as a feature of the compositions [[Over|with]] and [[Atop|over]]. New compositions such as <source lang=apl inline>f⍤g</source> were described as "close in the sense that the expression… is applied individually to each subarray argument of <source lang=apl inline>g</source>".<ref>K.E. Iverson. [https://www.jsoftware.com/papers/satn41.htm "Composition and Enclosure"]. SATN 41, 1981-06-20.</ref> The concept of function rank was formalized, and applied to most primitives, when the [[Rank operator]] was introduced to SHARP version 19.0 in 1987.<ref>Bernecky, Robert. [https://dl.acm.org/citation.cfm?id=55632 "An Introduction to Function Rank"]. APL88 Conference Proceedings. ''ACM SIGAPL Quote Quad'', 18(2), December 1987.</ref> In [[J]] every function, primitive or user-defined, has a function rank.


== Definition and properties ==
== Definition and properties ==

Navigation menu