From c3ea468236e362e4ecc1bc27aed7a64d90e7cf81 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 2 Jun 2022 21:42:44 -0400 Subject: Always use "index list", not "list index", for a full element index --- docs/doc/range.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/doc/range.html') diff --git a/docs/doc/range.html b/docs/doc/range.html index 6a8409ac..8065a34a 100644 --- a/docs/doc/range.html +++ b/docs/doc/range.html @@ -15,7 +15,7 @@ ⟨ 1 0 ⟩ ⟨ 1 1 ⟩ ⟨ 1 2 ⟩ ┘ -

It's really two different functions packed together: if 𝕩 is a natural number—a length—then it returns a list of numeric indices, but if it's a list of numbers, then it returns an array of list indices. This means the result always has depth one more than the argument.

+

It's really two different functions packed together: if 𝕩 is a natural number—a length—then it returns a list of numeric indices, but if it's a list of numbers, then it returns an array of index lists. This means the result always has depth one more than the argument.

The two kinds of index correspond to BQN's two selection functions: Select () works with indices along an axis, which are numbers, and Pick () works with element indices, which are lists. The examples below would fail if we swapped these around. Each result from Range is a length-6 list, but their elements are different.

↗️
    6
 ⟨ 0 1 2 3 4 5 ⟩
-- 
cgit v1.2.3