Content deleted Content added
Narky Blert (talk | contribs) Link to DAB page repaired |
intro "dop" from outset |
||
Line 1:
{{redirect|Dfns|the political entity sometimes known as the Democratic Federation of Northern Syria|Rojava}}
A '''direct function''' ('''dfn''', pronounced "dee fun") is an alternative way to define a function and operator (a [[higher-order function]]) in the programming language [[APL (programming language)|APL]]. A dfn operator can also be called a '''dop''' (pronounced "dee op"). They were invented by [[John M. Scholes|John Scholes]] in 1996.<ref name=Scholes1996>{{cite journal|last=Scholes|first=John|title=Direct Functions in Dyalog APL|journal=Vector|volume=13|number=2|date=October 1996|url=http://www.dyalog.com/uploads/documents/Papers/dfns.pdf|access-date=16 September 2019}}</ref> They are a unique combination of [[array programming]], higher-order function, and [[functional programming]], and are a major distinguishing advance of early 21st century APL over prior versions.
A dfn is a sequence of possibly [[Guard (computer science)|guarded expressions]] (or just a guard) between {{code|{|apl}} and {{code|}|apl}}, separated by {{code|⋄|apl}} or new-lines, wherein {{code|⍺|apl}} denotes the left argument and {{code|⍵|apl}} the right, and {{code|∇|apl}} denotes [[Recursion (computer science)|recursion]] (function self-reference). For example, the function {{code|PT|apl}} tests whether each row of {{code|⍵|apl}} is a [[Pythagorean triplet]] (by testing whether the sum of squares equals twice the square of the maximum).
|