Primitive operator: Difference between revisions
Miraheze>Adám Brudzewsky No edit summary |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
A '''primitive operator''' is a kind of [[operator]] which is defined by the language. Like a [[primitive function]], a primitive operator is written with a single [[glyph]] in APL but may use multiple characters in other languages. The one exception to the single-glyph rule is the [[Outer Product]], which is written < | A '''primitive operator''' is a kind of [[operator]] which is defined by the language. Like a [[primitive function]], a primitive operator is written with a single [[glyph]] in APL but may use multiple characters in other languages. The one exception to the single-glyph rule is the [[Outer Product]], which is written <syntaxhighlight lang=apl inline>∘.</syntaxhighlight>. While some dialects consider the outer product to be a case of the [[dyadic operator]] [[Inner Product]] with a [[Jot]] (which they interpret as <syntaxhighlight lang=apl inline>⊂⍬</syntaxhighlight>) as its left operand, others consider it to be a primitive [[monadic operator]] on its own. | ||
Primitive operators have historically been very limited, a condition which has caused greater variety in modern operators than in functions as language designers have extended the scope of operators in different ways. [[Iverson notation]] did not have a unified concept of an operator, and considered everything which is now an APL operator to be a form of special syntax. [[APL\360]] generalized the concept of an operator, but defined only a small number of them: [[reduction]]s, [[scan]]s, [[inner product]]s, and [[outer product]]s. These operators applied only to primitive functions. | Primitive operators have historically been very limited, a condition which has caused greater variety in modern operators than in functions as language designers have extended the scope of operators in different ways. [[Iverson notation]] did not have a unified concept of an operator, and considered everything which is now an APL operator to be a form of special syntax. [[APL\360]] generalized the concept of an operator, but defined only a small number of them: [[reduction]]s, [[scan]]s, [[inner product]]s, and [[outer product]]s. These operators applied only to primitive functions. | ||
Line 5: | Line 5: | ||
Dialects which are notable for introducing many primitive operators include [[SHARP APL]], [[J]], [[Dyalog APL]] (which has adopted some operators from J), and [[NARS2000]]. | Dialects which are notable for introducing many primitive operators include [[SHARP APL]], [[J]], [[Dyalog APL]] (which has adopted some operators from J), and [[NARS2000]]. | ||
{{APL | {{APL features}}[[Category:Primitive operators| ]][[Category:Operators]] |
Latest revision as of 22:19, 10 September 2022
A primitive operator is a kind of operator which is defined by the language. Like a primitive function, a primitive operator is written with a single glyph in APL but may use multiple characters in other languages. The one exception to the single-glyph rule is the Outer Product, which is written ∘.
. While some dialects consider the outer product to be a case of the dyadic operator Inner Product with a Jot (which they interpret as ⊂⍬
) as its left operand, others consider it to be a primitive monadic operator on its own.
Primitive operators have historically been very limited, a condition which has caused greater variety in modern operators than in functions as language designers have extended the scope of operators in different ways. Iverson notation did not have a unified concept of an operator, and considered everything which is now an APL operator to be a form of special syntax. APL\360 generalized the concept of an operator, but defined only a small number of them: reductions, scans, inner products, and outer products. These operators applied only to primitive functions.
Dialects which are notable for introducing many primitive operators include SHARP APL, J, Dyalog APL (which has adopted some operators from J), and NARS2000.
APL features [edit] | |
---|---|
Built-ins | Primitives (functions, operators) ∙ Quad name |
Array model | Shape ∙ Rank ∙ Depth ∙ Bound ∙ Index (Indexing) ∙ Axis ∙ Ravel ∙ Ravel order ∙ Element ∙ Scalar ∙ Vector ∙ Matrix ∙ Simple scalar ∙ Simple array ∙ Nested array ∙ Cell ∙ Major cell ∙ Subarray ∙ Empty array ∙ Prototype |
Data types | Number (Boolean, Complex number) ∙ Character (String) ∙ Box ∙ Namespace ∙ Function array |
Concepts and paradigms | Conformability (Scalar extension, Leading axis agreement) ∙ Scalar function (Pervasion) ∙ Identity element ∙ Complex floor ∙ Array ordering (Total) ∙ Tacit programming (Function composition, Close composition) ∙ Glyph ∙ Leading axis theory ∙ Major cell search ∙ First-class function |
Errors | LIMIT ERROR ∙ RANK ERROR ∙ SYNTAX ERROR ∙ DOMAIN ERROR ∙ LENGTH ERROR ∙ INDEX ERROR ∙ VALUE ERROR ∙ EVOLUTION ERROR |