Index origin: Difference between revisions

Jump to navigation Jump to search
48 bytes added ,  08:08, 5 June 2020
m (Iota -> Index Generator)
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Built-in|Index origin|⎕IO}} is the number used for the first [[index]] along each [[axis]] of an array. Many APLs allow the user to configure index origin using the [[system variable]] <source lang=apl inline>⎕IO</source>. Even array languages which do not have such a configuration parameter must make a choice of index origin; for example, [[A+]] and [[J]] use a non-configurable index origin of 0. The [[wikipedia:English language|English language]] uses an index origin of one: thus the element with index <source lang=apl inline>⎕IO</source> in APL is referred to in English as the "first" element.
{{Built-in|Index origin|⎕IO}} is the number used for the first [[index]] along each [[axis]] of an array. Many APLs allow the user to configure index origin using the [[system variable]] <source lang=apl inline>⎕IO</source>. Even array languages which do not have such a configuration parameter must make a choice of index origin; for example, [[A+]] and [[J]] use a non-configurable index origin of 0. The [[wikipedia:English language|English language]] uses an index origin of one: thus the element with index <source lang=apl inline>⎕IO</source> in APL is referred to in English as the "first" element.


The index origin affects both the handling of index arguments to functions (and other functionality like [[axis specification]]) and their results. For example, [[Index Generator]] creates results which begin with <source lang=apl inline>⎕IO</source>.
The index origin affects both the handling of index arguments to functions (and other functionality like [[axis specification]]) and their results. For example, [[Index Generator]] creates results that begin with <source lang=apl inline>⎕IO</source>.
<source lang=apl>
<source lang=apl>
       ⎕IO←0
       ⎕IO←0
Line 37: Line 37:
|}
|}


Additionally, [[indexing]] with brackets and [[axis specification]] depend on index origin.
Additionally, [[Bracket indexing|indexing]] with brackets and [[axis specification]] depend on index origin.


== External links ==
== External links ==
Line 43: Line 43:
=== Articles ===
=== Articles ===


* [[wikipedia:Array_data_type#Index_origin|Wikipedia]]
* [[wikipedia:Array data type#Index origin|Index origin]]
* [https://www.jsoftware.com/papers/indexorigin.htm Is Index Origin 0 a Hindrance?]
* [https://www.jsoftware.com/papers/indexorigin.htm Is Index Origin 0 a Hindrance?]


Line 54: Line 54:
* [https://help.dyalog.com/latest/index.htm#Language/System%20Functions/io.htm Dyalog]
* [https://help.dyalog.com/latest/index.htm#Language/System%20Functions/io.htm Dyalog]
* [http://microapl.com/apl_help/ch_020_070_380.htm APLX]
* [http://microapl.com/apl_help/ch_020_070_380.htm APLX]
{{APL built-ins}}
{{APL built-ins}}[[Category:System constants]]
trusted
183

edits

Navigation menu