Function styles: Difference between revisions

Jump to navigation Jump to search
→‎Tacit functions: Some description of function assignment moved to Assignment
(→‎Tacit functions: More specific history of function assignment)
(→‎Tacit functions: Some description of function assignment moved to Assignment)
Line 31: Line 31:
{{Main|Tacit programming}}
{{Main|Tacit programming}}


Another kind of function which can be created by the programmer are tacit functions, so named because they do not include any mention of their arguments, leaving them unsaid. Languages with tacit functions call the other types of functions, which do refer to arguments as part of a function body, "explicit" functions. Tacit functions are created as values: [[derived function]]s and [[train]]s are two kinds of tacit function. For example <syntaxhighlight lang=apl inline>+/</syntaxhighlight>, [[Plus]] [[Reduce]], is a derived function that can be created in any APL. However, early APLs usually did not allow [[assign]]ing a name to such functions: the only ways to call them were to write the function out explicitly and to define an equivalent explicit function. Function assignment was proposed by Iverson in 1981<ref>[[Ken Iverson]] and Peter Wooster. [https://dl.acm.org/doi/abs/10.1145/390007.805349 A function definition operator] at [[APL81]].</ref> and added to [[Dyalog APL]] in 1986. Since the promotion of tacit programming by [[J]] in the 90s it is present in all new APLs.
Another kind of function which can be created by the programmer are tacit functions, so named because they do not include any mention of their arguments, leaving them unsaid. Languages with tacit functions call the other types of functions, which do refer to arguments as part of a function body, "explicit" functions. Tacit functions are created as values: [[derived function]]s and [[train]]s are two kinds of tacit function. For example <syntaxhighlight lang=apl inline>+/</syntaxhighlight>, [[Plus]] [[Reduce]], is a derived function that can be created in any APL. However, early APLs usually did not allow [[assign]]ing a name to such functions: the only ways to call them were to write the function out explicitly and to define an equivalent explicit function. [[Function assignment]], allowing derived functions to be used directly, began to be supported in the 1980s.


== References ==
== References ==
<references/>
<references/>
{{APL syntax}}[[Category:Defining functions| ]]
{{APL syntax}}[[Category:Defining functions| ]]

Navigation menu