Index Generator: Difference between revisions

Jump to navigation Jump to search
2,104 bytes added ,  05:19, 29 July 2020
m
(→‎Outside of APL: C++ and Go usage)
(10 intermediate revisions by 2 users not shown)
Line 84: Line 84:
== History ==
== History ==


The notation <math>\iota_o(n)</math>, "Interval", was used in [[Iverson notation]] for the vector of the first <math>n</math> indices starting at [[index origin]] <math>o</math>. Both arguments were optional, with <math>n</math> being implied by [[conformability]] if omitted. It was adopted with the obvious alterations in [[APL\360]], and extended to a vector argument for [[nested array theory|nested]] APLs by [[NARS]] and for [[flat array theory|flat]] arrays by [[A+]].
The Greek letter iota, corresponding to the Latin letter i, now usually treated as a mnemonic for "integers" or "[[index]]", more likely stood for "identity" in early [[Iverson notation]]. [[Ken Iverson|Iverson]]'s 1960 paper ''The Description of Finite Sequential Processes'' states that "the identity [[permutation]] vector <math>\iota</math> is defined by the relation <math>\iota_j=j</math>."<ref>[[Ken Iverson]]. [https://www.jsoftware.com/papers/DFSP.htm ''The Description of Finite Sequential Processes'']. Proceedings of a Conference on Information Theory, C. Cherry and W. Jackson, Editors, Imperial College, London, 1960-08-29.</ref> Since <math>e</math> is a more typical letter to use for the identity permutation, it's possible that Iverson's choice was also motivated by the convention of using <math>\iota</math> for an [[wikipedia:inclusion map|inclusion map]], where iota now indicates "inclusion" or "injection".<ref name="iotashaming">Sean Parent. [https://sean-parent.stlab.cc/2019/01/04/iota.html "#iotashaming"]. sean-parent.stlab.cc. 2019-01-04.</ref> The term "inclusion" typically indicates that a particular injection is meant to be treated as an identity.
 
The notation <math>\iota_o(n)</math>, "Interval", was used in [[A Programming Language]] for the vector of the first <math>n</math> indices starting at [[index origin]] <math>o</math>. Both arguments were optional, with <math>n</math> being implied by [[conformability]] if omitted. It was adopted with the obvious alterations in [[APL\360]], and extended to a vector argument for [[nested array theory|nested]] APLs by [[NARS]] and for [[flat array theory|flat]] arrays by [[A+]].


== Outside of APL ==
== Outside of APL ==


The name "iota" has sometimes been used to indicate an increasing sequence of integers even in languages other than APL. In the [[wikipedia:C++|C++11]] standard library, <source lang=c++ inline>std::iota()</source> fills an iterator with such a sequence, and was named after the APL glyph.<ref>cppreference.com. [https://en.cppreference.com/w/cpp/algorithm/iota std::iota]. Retrieved 2020-04-28.</ref><ref>Rob Mayoff. [https://stackoverflow.com/a/9244949 Answer to "What does iota of std::iota stand for?"] on Stack Overflow.  Retrieved 2020-04-28.</ref> The [[wikipedia:Go (programming language)|Go]] language also uses the name <source lang=go inline>iota</source> as a predeclared identifier which represents increasing integers: each time it is used within a single constant declaration its value will be one higher.<ref>The Go Programming Language Specification. [https://golang.org/ref/spec#Iota Iota]. 2020-01-14.</ref>
The name "iota" has sometimes been used to indicate an increasing sequence of integers even in languages other than APL. In the [[wikipedia:C++|C++11]] standard library, <source lang=c++ inline>std::iota()</source> fills an iterator with such a sequence, and was named after the APL glyph.<ref>cppreference.com. [https://en.cppreference.com/w/cpp/algorithm/iota std::iota]. Retrieved 2020-04-28.</ref><ref name="iotashaming"/><ref>Rob Mayoff. [https://stackoverflow.com/a/9244949 Answer to "What does iota of std::iota stand for?"] on Stack Overflow.  Retrieved 2020-04-28.</ref> The [[wikipedia:Go (programming language)|Go]] language also uses the name <source lang=go inline>iota</source> as a predeclared identifier which represents increasing integers: each time it is used within a single constant declaration its value will be one higher.<ref>The Go Programming Language Specification. [https://golang.org/ref/spec#Iota Iota]. 2020-01-14.</ref> The popular [[wikipedia:Scheme (programming language)|Scheme]] list library SRFI 1 also includes a function called <source lang=scheme inline>iota</source> in reference to APL, which takes a count as well as optional starting value (default 0) and step size (default 1) arguments.<ref>Olin Shivers. [https://srfi.schemers.org/srfi-1/srfi-1.html#iota SRFI 1: List Library]. Finalized 1999-10-09.</ref> The [[wikipedia:ArrayFire|ArrayFire]] library for [[wikipedia:general-purpose computing on graphics processing units|general-purpose computing on graphics processing units]] has an <source lang=c inline>iota</source> function with a result similar to that of A+ and J when given a [[#Vector_arguments|vector argument]].<ref>ArrayFire: Functions. [https://arrayfire.org/docs/group__data__func__iota.htm iota]. Jun 2, 2015.</ref>


== See also ==
* [[Range]]
== External links ==
== External links ==
=== Tutorials ===
=== Tutorials ===
Line 96: Line 100:
=== Documentation ===
=== Documentation ===


* [http://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Index%20Generator.htm Dyalog]
* [https://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Index%20Generator.htm Dyalog]
* [http://wiki.nars2000.org/index.php/Index_Generator NARS2000]
* [http://wiki.nars2000.org/index.php/Index_Generator NARS2000]
* [http://microapl.com/apl_help/ch_020_020_150.htm APLX]
* [http://microapl.com/apl_help/ch_020_020_150.htm APLX]
Line 103: Line 107:
== References ==
== References ==
<references />
<references />
{{APL built-ins}}
{{APL built-ins}}[[Category:Primitive functions]]

Navigation menu