From 8f9c4f9976ae61164679e20926e66312e6ada092 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 25 Aug 2020 21:27:56 -0400 Subject: Clarify Indices introduction --- docs/doc/indices.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/doc/indices.html') diff --git a/docs/doc/indices.html b/docs/doc/indices.html index 8ebf5bdc..31caa122 100644 --- a/docs/doc/indices.html +++ b/docs/doc/indices.html @@ -5,7 +5,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, 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.

@@ -38,7 +38,7 @@ - + -- cgit v1.2.3
𝕨/𝕩𝕩/𝕨 Along-axis scalar