Primitive function: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
Miraheze>Marshall
(Created page with "A primitive function is a function defined by the language. Outside of the array community, such functions may be called "builtin" or "intrinsic" functions. In APL, each i...")
 
m (Kinds of functions category)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
A primitive function is a [[function]] defined by the language. Outside of the array community, such functions may be called "builtin" or "intrinsic" functions. In APL, each is represented with a single [[glyph]]; in other languages, such as those restricted to [https://en.wikipedia.org/wiki/ASCII ASCII] characters, they may use multiple characters ("bigraphs" and "trigraphs" are combinations of two and three characters, respectively).
A '''primitive function''' is a [[function]] defined by the language. Outside of the array community, such functions may be called "builtin" or "intrinsic" functions. In APL, each is represented with a single [[glyph]]; in other languages, such as those restricted to [[wikipedia:ASCII|ASCII]] characters, they may use multiple characters ("bigraphs" and "trigraphs" are combinations of two and three characters, respectively).


Other parts of APL which are written with a single glyph include [[Primitive operator|primitive operators]] and [[Quad]].
Other parts of APL which are written with a single glyph include [[primitive operator]]s and [[Quad]].


Early APL implementations divided primitives into [[Scalar function|scalar functions]], which apply one element at a time, and [[Mixed function|mixed functions]], which do not. Modern APLs universally retain the terminology "scalar function" but may deemphasize its opposite "mixed function" or subdivide it further. Two prominent subcategories of functions are [[Structural function|structural functions]], which rearrange elements of the argument or its subarrays without regard to their values, and [[Set functions|set functions]], which return a result or manipulate arrays based on which cells or elements are equal to other cells or elements.
Early APL implementations divided primitives into [[scalar function]]s, which apply one element at a time, and [[mixed function]]s, which do not. Modern APLs universally retain the terminology "scalar function" but may deemphasize its opposite "mixed function" or subdivide it further. Two prominent subcategories of functions are [[structural function]]s, which rearrange elements of the argument or its subarrays without regard to their values, and [[set function]]s, which return a result or manipulate arrays based on which [[cell]]s or [[element]]s [[match]] other cells or elements.


A function is distinct from the [[glyph]] used to denote it. Different APLs, or even one APL (using [[Migration level]]) might use the same glyph for multiple functions, or different glyphs for identical or similar functions. The term "function" can, depending on context, refer either to an [[ambivalent]] function which can be applied with one or two arguments, or the [[Monad|monadic]] or [[Dyad|dyadic]] function obtained by restricting that function to either one or two arguments specifically.
A function is distinct from the [[glyph]] used to denote it. Different APLs, or even one APL (using [[migration level]]) might use the same glyph for multiple functions, or different glyphs for identical or similar functions. The term "function" can, depending on context, refer either to an [[ambivalent]] function which can be applied with one or two arguments, or the [[monadic]] or [[dyadic]] function obtained by restricting that function to either one or two arguments specifically.
 
{{APL built-ins}}[[Category:Kinds of functions]]

Latest revision as of 14:43, 30 April 2020

A primitive function is a function defined by the language. Outside of the array community, such functions may be called "builtin" or "intrinsic" functions. In APL, each is represented with a single glyph; in other languages, such as those restricted to ASCII characters, they may use multiple characters ("bigraphs" and "trigraphs" are combinations of two and three characters, respectively).

Other parts of APL which are written with a single glyph include primitive operators and Quad.

Early APL implementations divided primitives into scalar functions, which apply one element at a time, and mixed functions, which do not. Modern APLs universally retain the terminology "scalar function" but may deemphasize its opposite "mixed function" or subdivide it further. Two prominent subcategories of functions are structural functions, which rearrange elements of the argument or its subarrays without regard to their values, and set functions, which return a result or manipulate arrays based on which cells or elements match other cells or elements.

A function is distinct from the glyph used to denote it. Different APLs, or even one APL (using migration level) might use the same glyph for multiple functions, or different glyphs for identical or similar functions. The term "function" can, depending on context, refer either to an ambivalent function which can be applied with one or two arguments, or the monadic or dyadic function obtained by restricting that function to either one or two arguments specifically.


APL built-ins [edit]
Primitives (Timeline) Functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare RootRound
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentityStopSelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndexCartesian ProductSort
Selector Index generatorGradeIndex OfInterval IndexIndicesDealPrefix and suffix vectors
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-BeamSpawnFunction axisIdentity (Null, Ident)
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductDeterminantPowerAtUnderRankDepthVariantStencilCutDirect definition (operator)Identity (Lev, Dex)
Quad names Index originComparison toleranceMigration levelAtomic vector