From e9fd7e6f6bc6d67fe16ea49b738481e0d4c61fac Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Fri, 13 May 2022 22:06:04 -0400 Subject: Fix typos and an awkward formulation --- docs/doc/array.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/array.html') diff --git a/docs/doc/array.html b/docs/doc/array.html index 1eeb5ee6..d941f90a 100644 --- a/docs/doc/array.html +++ b/docs/doc/array.html @@ -111,12 +111,12 @@ "beforeafter"

It's only the ordering that allows positions to be distinguished. BQN labels them with natural numbers called indices that can be derived from the order: the earliest position is called 0, the next 1, and so on. The axes of an array are also ordered, and they're indexed starting at 0 as well.

-

These kinds of index are one-dimensional, but there's also a multidimensional kind of array index, that identifies an element. An element index consists of one index along each axis. Because the axis are ordered, it can be represented as a list l of numbers, where il is the index along axis i. It's important to distinguish an element from its value: for example, there's only one value (3) contained in the array 3,3,3, but it still has three elements, identified by indices 0, 1, and 2.

+

These kinds of index are one-dimensional, but there's also a multidimensional kind of array index, that identifies an element. An element index consists of one index along each axis. Because the axes are ordered, the element index can be represented as a list l of numbers, where il is the index along axis i. It's important to distinguish an element from its value: for example, there's only one value (3) contained in the array 3,3,3, but it still has three elements, identified by indices 0, 1, and 2.

Dimensions

-

The number of axes in an array is called its rank. The number of positions along an axis is called its length, and the length of an array means its length along the first axis, or 1 if there are no axes. The list of the length along each axis is the array's shape, and describes the possible element locations completely. In BQN they're exposed as the functions Rank (=), Length (), and Shape ().

-

The total number of elements in an array is its bound, and can be found using Deshape with , is then the product of all the lengths in the shape. An array of rank 0, which always contains exactly one element, is called a unit, while an array of rank 1 is called a list and an array of rank 2 is called a table.

+

The number of axes in an array is called its rank. The number of positions along an axis is called its length, and the length of an array means its length along the first axis, or 1 if there are no axes. The list of the lengths along each axis is the array's shape, and describes the possible element locations completely. In BQN they're exposed as the functions Rank (=), Length (), and Shape ().

+

The total number of elements in an array is its bound, and can be found using Deshape with , or by multiplying all the lengths in the shape. An array of rank 0, which always contains exactly one element, is called a unit, while an array of rank 1 is called a list and an array of rank 2 is called a table.

Elements

-

Any BQN value can be used as an array element, including another array (BQN, as a dynamically-typed language, doesn't restrict the types that can be used in one context without a good reason). However, BQN arrays are restricted relative to another array model. Frameworks like NumPy or Julia have mutable arrays, so that the value of an element can be changed after the array is created. This allows an array to be its own element, by creating an array and then inserting it into itself. This would be unnatural in BQN, where an array can only be formed from elements that already exist. In BQN only operations and namespaces are mutable.

+

Any BQN value can be used as an array element, including another array (BQN, as a dynamically-typed language, doesn't restrict the types that can be used in one context without a good reason). However, BQN arrays are restricted relative to other array models. Frameworks like NumPy or Julia have mutable arrays, so that the value of an element can be changed after the array is created. This allows an array to be its own element, by creating an array and then inserting it into itself. This would be unnatural in BQN, where an array can only be formed from elements that already exist. In BQN only operations and namespaces are mutable.

Properties

Summarizing, the values needed to define an array are its rank (the number of axes), its shape (the number of positions along each axis), and the value of each element (that is, at each combination of positions). Two arrays match when all these values match.

If the rank is considered to be part of the shape, as it is when the shape is a BQN list, then the array is defined by its shape and element list—from deshape.

-- cgit v1.2.3