From 8533da8eaab9712485ed838dcb2eff90cd8fc5b2 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 25 Jul 2021 22:22:19 -0400 Subject: Documentation about arrays (bland) --- docs/doc/types.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/doc/types.html') diff --git a/docs/doc/types.html b/docs/doc/types.html index cef41290..46356766 100644 --- a/docs/doc/types.html +++ b/docs/doc/types.html @@ -57,6 +57,7 @@

Other linear combinations such as adding two characters or negating a character are not allowed. You can check whether an application of + or - on numbers and characters is allowed by applying the same function to the "characterness" of each value: 0 for a number and 1 for a character. The result will be a number if this application gives 0 and a character if this gives 1, and otherwise the operation is not allowed.

Arrays

+

Full documentation here.

A BQN array is a multidimensional arrangement of data. This means it has a certain shape, which is a finite list of natural numbers giving the length along each axis, and it contains an element for each possible index, which is a choice of one natural number that's less than each axis length in the shape. The total number of elements, or bound, is then the product of all the lengths in the shape. The shape may have any length including zero, and this shape is known as the array's rank. 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.

Each array—empty or nonempty—has an inferred property called a fill. The fill either indicates what element should be used to pad an array, or that such an element is not known and an error should result. Fills can be used by Take (), the two Nudge functions (»«), First (), and Reshape ().

Arrays are value types (or immutable), so that there is no way to "change" the shape or elements of an array. An array with different properties is a different array. As a consequence, arrays are an inductive type, and it's not possible for an array to contain itself, or contain an array that contains itself, and so on. However, it is possible for an array to contain a function or other operation that has access to the array through a variable, and in this sense an array can "know about" itself.

-- cgit v1.2.3