Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
APL (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Terminology === APL makes a clear distinction between ''functions'' and ''operators''.<ref name="MicroAOL_Operators"/><ref>{{cite web |last1=Iverson |first1=Kenneth E. |author-link=Kenneth E. Iverson |year=1987 |title=A Dictionary of APL |url=http://www.jsoftware.com/papers/APLDictionary.htm |website=www.jsoftware.com |access-date=January 20, 2015}}</ref> Functions take arrays (variables or constants or expressions) as arguments, and return arrays as results. Operators (similar to [[higher-order function]]s) take functions or arrays as arguments, and derive related functions. For example, the ''sum'' function is derived by applying the ''reduction'' operator to the ''addition'' function. Applying the same reduction operator to the ''maximum'' function (which returns the larger of two numbers) derives a function which returns the largest of a group (vector) of numbers. In the J language, Iverson substituted the terms ''verb'' for ''function'' and ''adverb'' or ''conjunction'' for ''operator''. APL also identifies those features built into the language, and represented by a symbol, or a fixed combination of symbols, as ''primitives''. Most primitives are either functions or operators. Coding APL is largely a process of writing non-primitive functions and (in some versions of APL) operators. However a few primitives are considered to be neither functions nor operators, most noticeably assignment. Some words used in APL literature have meanings that differ from those in both mathematics and the generality of computer science. {| class="wikitable" |+Terminology of APL operators |- !scope="col"| Term !scope="col"| Description |- !scope="row"| function | operation or mapping that takes zero, one (right) or two (left & right) arguments which may be scalars, arrays, or more complicated structures, and may return a similarly complex result. A function may be: * Primitive: built-in and represented by a single glyph;<ref name="aplxch6">{{cite web |url=http://www.microapl.co.uk/APL/apl_concepts_chapter6.html |title=APL concepts |publisher=Microapl.co.uk |access-date=February 3, 2010}}</ref> * Defined: as a named and ordered collection of program statements;<ref name="aplxch6"/> * Derived: as a combination of an operator with its arguments.<ref name="aplxch6"/> |- !scope="row"| array | data valued object of zero or more [[orthogonal]] dimensions in [[Row- and column-major order|row-major]] order in which each item is a primitive scalar datum or another array.<ref>{{cite web |url=http://www.nial.com/ArrayTheory.html |title=Nested array theory |publisher=Nial.com |access-date=February 3, 2010 |archive-url=https://web.archive.org/web/20110709072354/http://www.nial.com/ArrayTheory.html |archive-date=2011-07-09 |url-status=dead}}</ref> |- !scope="row"| niladic | not taking or requiring any arguments, nullary<ref name="Bohman_Froberg">"Programmera i APL", Bohman, Fröberg, [[Studentlitteratur]], {{ISBN|91-44-13162-3}}</ref> |- !scope="row"| monadic | requiring only one argument; on the right for a function, on the left for an operator, unary<ref name="Bohman_Froberg"/> |- !scope="row"| dyadic | requiring both a left and a right argument, binary<ref name="Bohman_Froberg"/> |- !scope="row"| ambivalent<br/>or monadic | capable of use in a monadic or dyadic context, permitting its left argument to be elided{{Definition needed|date=February 2024}}<ref name="aplxch6"/> |- !scope="row"| operator | operation or mapping that takes one (left) or two (left & right) function or array valued arguments (operands) and derives a function. An operator may be: * Primitive: built-in and represented by a single glyph;<ref name="aplxch6"/> * Defined: as a named and ordered collection of program statements.<ref name="aplxch6"/> |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)