Defined function (traditional): Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
A '''user-defined function''' (or '''tradfn''', for "traditional function", in [[Dyalog APL]]) is a function defined using a header that includes the function's name. Introduced in [[APL\360]], function definition was universally supported by APL dialects for much of the language's history, and is still commonly used in mainstream APLs. Since the 1990s other ways to [[Function styles|describe functions]] have appeared, with [[J]] and [[K]] rejecting function definition in favor of [[anonymous function]] description. Beginning in the 2010s [[Dyalog]]-based APL dialects including [[ngn/apl]], [[dzaima/APL]], and [[APL\iv]] have removed function definition in favor of [[dfn]]s.
A '''user-defined function''' (or '''tradfn''', for "traditional function", in [[Dyalog APL]]) is a function defined using a header that includes the function's name. Introduced in [[APL\360]], function definition was universally supported by APL dialects for much of the language's history, and is still commonly used in mainstream APLs. Since the 1990s other ways to [[Function styles|describe functions]] have appeared, with [[J]] and [[K]] rejecting function definition in favor of [[anonymous function]] description. Beginning in the 2010s [[Dyalog]]-based APL dialects including [[ngn/apl]], [[dzaima/APL]], and [[APL\iv]] have removed function definition in favor of [[dfn]]s.


In many dialects the function header syntax of defined functions is adapted to allow user-defined [[operator]]s as well.
In many dialects the function header syntax of defined functions is adapted to allow user-defined [[operator]]s as well. A tradfn operator can also be called a '''tradop''' (pronounced "trad op"), parallel to how a "dfn" operator can be called a ''dop''.


== Examples ==
== Examples ==
Line 77: Line 77:


== Representations ==
== Representations ==
The canonical representation form is equivalent to what the user would type into the [[line editor]] to define the function. An alternative representation consists of the entire [[session]] log transcript after having such a definition has been made. A tradfn operator can also be called a '''tradop''' (pronounced "trad op").
The canonical representation form is equivalent to what the user would type into the [[line editor]] to define the function. An alternative representation consists of the entire [[session]] log transcript, including [[Del]]s (<source lang=apl inline>∇</source>) and line numbers, after having such a definition has been made.


== Properties ==
== Properties ==

Navigation menu