aboutsummaryrefslogtreecommitdiff
path: root/doc/indices.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-25 21:27:56 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-25 21:27:56 -0400
commit8f9c4f9976ae61164679e20926e66312e6ada092 (patch)
treec64596e3ab284bc1d614cf2e34dad1d80a9a9364 /doc/indices.md
parentd2b372b66c473d4dbd51df6870ce5cb8ce9706b5 (diff)
Clarify Indices introduction
Diffstat (limited to 'doc/indices.md')
-rw-r--r--doc/indices.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/indices.md b/doc/indices.md
index cc7c5f67..a210f710 100644
--- a/doc/indices.md
+++ b/doc/indices.md
@@ -2,7 +2,7 @@
# Indices
-One-dimensional arrays such as K lists or Python arrays have only one kind of index, a single number that refers to an element. For multidimensional arrays using the leading axis theory, there are several types of indexing that can be useful. Historically, nested APL designs have equivocated between these, which I believe can lead to subtle errors when programming. BQN focuses on single-number (depth 0) indices, which can refer to list elements or array major cells (or more generally indexing along any particular axis). When using this kind of element index, indexed arrays are required to be lists. Only two functions allow the use of list element indices: Range (`↕`), which can accept a list argument, and Pick (`⊑`), which uses the depth-1 arrays in its left argument as index scalars or lists. Others use single-number indices to refer to cells.
+One-dimensional arrays such as K lists or Python arrays have only one kind of index, a single number that refers to an element. For multidimensional arrays using the [leading axis theory](leading.md), there are several types of indexing that can be useful. Historically, nested APL designs have equivocated between these, which I believe can lead to subtle errors when programming. BQN focuses on single-number (depth 0 or atomic) indices, which can refer to list elements or array major cells (or more generally indexing along any particular axis). When using atomic indices to select elements, the indexed array has to be a list. In contrast, elements of any array can be indicated by list indices, whose length is equal to the array's rank. Only two BQN primitives use these list indices: Range (`↕`), which returns an array of them if given a list argument, and Pick (`⊑`), where the depth-1 components of an array left argument are list indices.
The following functions take or return indices. Except where marked, the indices are in the result; this is by far the most common type of index use. `⊔` is given two rows as it falls into both cases. Note that in the result case, there is usually no possibility for the programmer to select the format of indices. Instead, the language should be carefully designed to make sure that the kind of index returned is as useful as possible.
@@ -11,7 +11,7 @@ The following functions take or return indices. Except where marked, the indices
| `↕` | | | Element scalar or list
| `/` | | | Element scalar
| `⊔` | | | Element scalar
-| `⊔` | `⊔` | `𝕨`/`𝕩` | Along-axis scalar
+| `⊔` | `⊔` | `𝕩`/`𝕨` | Along-axis scalar
| | `⊑` | `𝕨` | Element list
| `⍋` | `⍋` | | Major cell scalar
| `⍒` | `⍒` | | Major cell scalar