Template talk:APL built-ins: Difference between revisions

Jump to navigation Jump to search
m
Text replacement - "<source" to "<syntaxhighlight"
No edit summary
m (Text replacement - "<source" to "<syntaxhighlight")
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Grouping primitives ==
== Grouping primitives ==


Putting my thoughts here in the hopes that we'll eventually come to a better solution. There's no urgency to this, however, and I don't really have any idea what to do yet. Our current system is based on [[Dyalog]]'s, which I find unintelligible: why is [[Drop]] selection but [[Rotate]] structural? Would [[Sort by]] (like <source lang=apl inline>{⍺[⍋⍵]}</source>) be selection or selector? Since it doesn't seem to me that Dyalog's system reflects usage either across APLs or in the community, I think it's better to make one of our own based on goals that make sense for an encyclopedic wiki.
Putting my thoughts here in the hopes that we'll eventually come to a better solution. There's no urgency to this, however, and I don't really have any idea what to do yet. Our current system is based on [[Dyalog]]'s, which I find unintelligible: why is [[Drop]] selection but [[Rotate]] structural? Would [[Sort by]] (like <syntaxhighlight lang=apl inline>{⍺[⍋⍵]}</syntaxhighlight>) be selection or selector? Since it doesn't seem to me that Dyalog's system reflects usage either across APLs or in the community, I think it's better to make one of our own based on goals that make sense for an encyclopedic wiki.


Relatively recently, I added the category system, so that primitives can be placed in subcategories of [[:Category:APL primitives]] (and other built-ins in [[:Category:APL built-ins]]). Categories allow us to have overlapping groupings for primitives, so that for example [[Membership]] can be both a search function and a set function. However, they should be limited to groupings that are widely used and whose members are mostly agreed upon. No one's interested in a "Computational primitive functions according to Dyalog APL" category, and no one would ever agree on what to put in a "Computational primitive functions" category. But having a category system means we don't have to try to convey these kinds of essential categories in the navbox, unless they help with navigating the primitives.
Relatively recently, I added the category system, so that primitives can be placed in subcategories of [[:Category:APL primitives]] (and other built-ins in [[:Category:APL built-ins]]). Categories allow us to have overlapping groupings for primitives, so that for example [[Membership]] can be both a search function and a set function. However, they should be limited to groupings that are widely used and whose members are mostly agreed upon. No one's interested in a "Computational primitive functions according to Dyalog APL" category, and no one would ever agree on what to put in a "Computational primitive functions" category. But having a category system means we don't have to try to convey these kinds of essential categories in the navbox, unless they help with navigating the primitives.
Line 26: Line 26:
* evaluative, display, and control functions: Execute, Execute in Context, Protected Execute, Value, Value in Context, Result, Signal, Print, Stop;  Time.}}
* evaluative, display, and control functions: Execute, Execute in Context, Protected Execute, Value, Value in Context, Result, Signal, Print, Stop;  Time.}}


------
=== [[User:Bubbler|Bubbler]] ([[User talk:Bubbler|talk]]) 07:59, 22 June 2020 (UTC) ===


Given the flood of primitives, I think we might need a multi-level categorization. Here is a very rough (and kind-of arbitrary) draft for non-scalar functions (IMO, such an organization is also needed for scalar ones). --[[User:Bubbler|Bubbler]] ([[User talk:Bubbler|talk]]) 07:59, 22 June 2020 (UTC)
Given the flood of primitives, I think we might need a multi-level categorization. Here is a very rough (and kind-of arbitrary) draft for non-scalar functions (IMO, such an organization is also needed for scalar ones).
 
==== Non-scalar functions ====


* Identity
* Identity
Line 34: Line 36:
* Structural
* Structural
** Query: Shape, Tally, Depth
** Query: Shape, Tally, Depth
** Flat transform: Reshape, Ravel, Table, Catenate, Reverse, Rotate, Transpose, Take, Drop
** Flat transform: Reshape, Ravel, Table, Catenate, Reverse, Rotate, Transpose
** Nested transform: Enlist, Mix, Split, Enclose, Nest, Partitioned Enclose, Partition, Pair, Link
** Nested transform: Enclose, Nest, Mix, Split, Enlist, Partitioned Enclose, Partition, Pair, Link
* Selective
* Selective
** Indexing: First, Pick, Select, Bracket, Index
** Indexing: Bracket, First, Pick, Index, Select
** Take/Drop: Take, Drop
** Replicate/Expand: Replicate, Expand
** Replicate/Expand: Replicate, Expand
** Set: Unique, Intersection, Union, Without
** Set: Unique, Intersection, Union, Without
* Computational
* Computational
** Range: Index Generator
** Equality: Match, Not Match, Membership, Index Of, Find, Nub Sieve
** Equality: Match, Not Match, Membership, Index Of, Find, Nub Sieve
** Inequality: Grade, Interval Index
** Ordering: Grade, Interval Index
** Matrix: Matrix Inverse, Matrix Divide
** Matrix: Matrix Inverse, Matrix Divide
** Base: Encode, Decode
** Base: Encode, Decode
** Format/Execute: Format, Execute
** Format/Execute: Format, Execute
** Miscellaneous: Index Generator, Deal, Materialise
** Random: Deal
** Miscellaneous: Materialise
 
==== Scalar functions ====
 
* Arithmetic
** Monadic: Negate, Reciprocal, Magnitude, Exponential, Natural Logarithm, Floor, Ceiling, Square Root
** Dyadic: Add, Subtract, Times, Divide, Residue, Power, Logarithm, Root
* Boolean: Not, And, Or, Nand, Nor
* Comparison: Minimum, Maximum, Comparison functions
* Complex numbers: Conjugate, Imaginary, Complex
* Advanced mathematics: GCD, LCM, Factorial, Binomial, Pi Times, Circular
* Random numbers: Roll
* Miscellaneous: Type
 
==== Operators ====
 
* Spread: Each, Rank, Depth
* Product: Inner Product, Outer Product
* Replicate/Expand: Replicate, Expand
* Reduce/Scan: Reduce, Windowed Reduce, Scan
* Primitive Modifier: Function axis, Variant
* Functional: Commute, Constant, Bind, Compositions, Under
* Other: Power, Key, At, Stencil, Spawn, I-beam
 
=== [[User:Adám Brudzewsky|Adám Brudzewsky]] ([[User talk:Adám Brudzewsky|talk]]) 06:33, 30 June 2020 (UTC) ===
 
==== Non-scalar functions ====
 
* Structural
** Array properties: Shape, Tally, Depth
** Flat transform: Reshape, Ravel, Table, Catenate, Reverse, Rotate, Transpose
** Nested transform: First, Enclose, Nest, Mix, Split, Enlist, Partitioned Enclose, Partition, Pair, Link
* Selective
** No-op: Identity, Materialise
** Indexing: Bracket, Pick, Index, Select
** Affix: Take, Drop
** Mask: Replicate, Expand
** Set: Unique, Intersection, Union, Without
* Computational
** Generation: Integers, Deal
** Equality: Match, Not Match, Membership, Index Of, Find, Nub Sieve
** Ordering: Grade, Interval Index
** Matrix: Inverse, Divide
** Conversion: Encode, Decode, Format, Execute
 
==== Scalar functions ====
 
* Basic arithmetic: Negate, Reciprocal, Add, Subtract, Times, Divide
* Advanced mathematics: Exponential, Power, Natural Logarithm, Logarithm, Square Root, Root
* Comparison: Minimum, Maximum, Comparison functions
* Boolean: Not, And, Or, Nand, Nor
* Number theory: Residue, Floor, Ceiling, GCD, LCM
* Combinatorics: Roll, Factorial, Binomial
* Complex and trigonometry: Conjugate, Imaginary, Complex, Pi Times, Circular
* Properties: Magnitude, Sign, Type
 
==== Operators ====
 
* Spread: Each, Rank, Depth
* Product: Inner Product, Outer Product
* Mask: Replicate, Expand
* Reduction: Reduce, Windowed Reduce, Scan
* Modification: Axis, Variant, Spawn
* Functional: Commute, Constant, Bind, Compositions, Power, Under
* Selective application: At, Stencil, Key

Navigation menu