Index origin: Difference between revisions

Jump to navigation Jump to search
1,371 bytes added ,  14:56, 17 October 2019
no edit summary
Miraheze>Marshall
(Created page with "The index origin 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 <...")
 
Miraheze>Marshall
No edit summary
Line 14: Line 14:


The choice of which numbers are indices is subjective and must be made by the language designer. In some cases there is no clear decision: [[Interval Index]] and [[Occurrence Count]] each have natural definitions that depend on index origin, and natural definitions that do not.
The choice of which numbers are indices is subjective and must be made by the language designer. In some cases there is no clear decision: [[Interval Index]] and [[Occurrence Count]] each have natural definitions that depend on index origin, and natural definitions that do not.
== Functions which depend on index origin ==
The following functions depend on <code>⎕IO</code> in at least some APLs. They are listed with the [[glyphs]] used for them in [[Dyalog APL]]. For functions, only the result depends on <code>⎕IO</code> except where noted with <code>⍺</code> in which case the left argument does instead. For operators the dependence is noted.
{| class="wikitable c" style="margin:1em auto"
! [[Monadic functions]]        !! [[Dyadic functions]]                          !! [[Operators]]
|-
| [[Iota]] (<code>⍳</code>)    || [[Index-Of]] (<code>⍳</code>)                || [[Key]] (<code>⌸</code>) argument to <code>⍺⍺</code>
|-
| [[Roll]] (<code>?</code>)    || [[Roll]] (<code>?</code>)                    || [[At]] (<code>@</code>) result of <code>⍵⍵</code>
|-
| [[Grade]] (<code>⍒⍋</code>)  || (<code>⍒⍋</code>)                            ||
|-
| [[Indices]] (<code>⍸</code>)  || [[Interval Index]] (<code>⍸</code>)          ||
|-
|                              || [[Transpose]] (<code>⍉</code>) <code>⍺</code> ||
|-
|                              || [[Pick]] (<code>⊃</code>) <code>⍺</code>      ||
|-
|                              || [[Squad]] (<code>⌷</code>) <code>⍺</code>    ||
|}
Additionally, [[indexing]] with brackets and [[axis specification]] depend on index origin.


== External links ==
== External links ==
Anonymous user

Navigation menu