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/commentary/history.html | 2 +- docs/doc/array.html | 8 ++++---- docs/doc/order.html | 2 +- docs/doc/pair.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/commentary/history.html b/docs/commentary/history.html index cb296237..d1063fdd 100644 --- a/docs/commentary/history.html +++ b/docs/commentary/history.html @@ -211,7 +211,7 @@

APL array notation has been developed mainly by Phil Last and later Adám Brudzewsky. The big difference from array literals in other languages is the idea that newline should be a separator equivalent to , as it is in ordinary APL execution including dfns. The changes I made for BQN, other than the ligature discussed below, were to use dedicated bracket pairs ⟨⟩ and [], and to allow , as a separator.

I picked out the ligature character between YAG meetings, but I think Richard Park was most responsible for the idea of a "shortcut" list notation.

Double-struck special names

-

There was a lot of discussion about names for arguments at YAG (no one liked alpha and omega); I think Nathan Rogers suggested using Unicode's mathematical variants of latin letters and I picked out the double-struck ones. My impression is that we were approaching a general concensus that "w" and "x" were the best of several bad choices of argument letters, but that I was the first to commit to them.

+

There was a lot of discussion about names for arguments at YAG (no one liked alpha and omega); I think Nathan Rogers suggested using Unicode's mathematical variants of latin letters and I picked out the double-struck ones. My impression is that we were approaching a general consensus that "w" and "x" were the best of several bad choices of argument letters, but that I was the first to commit to them.

Assert primitive

Nathan Rogers suggested that assertion should be made a primitive to elevate it to a basic part of the language. I used J's assert often enough for this idea to make sense immediately, but I think it was new to me. He suggested the dagger character; I changed this to the somewhat similar-looking !. The error-trapping modifier is identical to J's ::, but J only has the function [: to unconditionally throw an error, with no way to set a message.

Context-free grammar

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.

diff --git a/docs/doc/order.html b/docs/doc/order.html index 3d5047ae..58ed2583 100644 --- a/docs/doc/order.html +++ b/docs/doc/order.html @@ -21,7 +21,7 @@ "δαβγ" "δγβα" -

Sort Down always matches Sort Up reversed, . The reason for this is that BQN's array ordering is a total order, meaning that if one array doesn't come earlier or later that another array in the ordering then the two arrays match. Since any two non-matching argument cells are strictly ordered, they will have one ordering in and the opposite ordering in . With the reverse, any pair of non-matching cells are ordered the same way in and . Since these two results have the same major cells in the same order, they match. However, note that the results will not always behave identically because Match doesn't take fill elements into account (if you're curious, take a look at ¨0,"" versus ¨0,"").

+

Sort Down always matches Sort Up reversed, . The reason for this is that BQN's array ordering is a total order, meaning that if one array doesn't come earlier or later than another array in the ordering then the two arrays match. Since any two non-matching argument cells are strictly ordered, they will have one ordering in and the opposite ordering in . With the reverse, any pair of non-matching cells are ordered the same way in and . Since these two results have the same major cells in the same order, they match. However, note that the results will not always behave identically because Match doesn't take fill elements into account (if you're curious, take a look at ¨0,"" versus ¨0,"").

Grade

diff --git a/docs/doc/pair.html b/docs/doc/pair.html index 12165060..a3a3a33e 100644 --- a/docs/doc/pair.html +++ b/docs/doc/pair.html @@ -62,4 +62,4 @@ ↗️
    4  "a"5  "b"7
 ⟨ ⟨ "a" 5 ⟩ ⟨ "b" 7 ⟩ ⟨ " " 0 ⟩ ⟨ " " 0 ⟩ ⟩
 
-

This means that may always behave the same as the obvious implementation {𝕩;𝕨,𝕩}. However, < and even >{𝕩;𝕨,𝕩}< compute the result fill as does and are identical implementations.

+

This means that may not always behave the same as the obvious implementation {𝕩;𝕨,𝕩}. However, < and even >{𝕩;𝕨,𝕩}< compute the result fill as does and are identical implementations.

-- cgit v1.2.3