From 4b9b761cc990f9247083ea28a32d9123bb752818 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 18 Jul 2020 23:35:02 -0400 Subject: Add a main repository link to html files and titles to spec files --- docs/doc/context.html | 1 + docs/doc/depth.html | 1 + docs/doc/fromDyalog.html | 1 + docs/doc/functional.html | 1 + docs/doc/group.html | 1 + docs/doc/index.html | 1 + docs/doc/indices.html | 1 + docs/doc/join.html | 1 + docs/doc/logic.html | 1 + docs/doc/transpose.html | 1 + docs/doc/windows.html | 1 + 11 files changed, 11 insertions(+) (limited to 'docs/doc') diff --git a/docs/doc/context.html b/docs/doc/context.html index f511c1ef..90963840 100644 --- a/docs/doc/context.html +++ b/docs/doc/context.html @@ -1,4 +1,5 @@ +

BQN's context-free grammar

APL has a problem. To illustrate, let's look at an APL expression:

a b c d e
diff --git a/docs/doc/depth.html b/docs/doc/depth.html
index ea3ad9c7..92e05dd3 100644
--- a/docs/doc/depth.html
+++ b/docs/doc/depth.html
@@ -1,4 +1,5 @@
 
+
 

Depth

The depth of an array is the greatest level of array nesting it attains, or, put another way, the greatest number of times you can pick an element starting from the original array before reaching a non-array. The monadic function Depth () returns the depth of its argument, while the 2-modifier Depth () can control the way its left operand is applied based on the depth of its arguments. Several primitive functions also use the depth of the left argument to decide whether it applies to a single axis of the right argument or to several axes.

The Depth function

diff --git a/docs/doc/fromDyalog.html b/docs/doc/fromDyalog.html index 723b832b..70bdb134 100644 --- a/docs/doc/fromDyalog.html +++ b/docs/doc/fromDyalog.html @@ -1,4 +1,5 @@ +

BQN–Dyalog APL dictionary

A few tables to help users of Dyalog APL (or similar) get started quickly on BQN. Here we assume ML is 1 for Dyalog.

For reading

diff --git a/docs/doc/functional.html b/docs/doc/functional.html index bc1b7c73..7e208167 100644 --- a/docs/doc/functional.html +++ b/docs/doc/functional.html @@ -1,4 +1,5 @@ +

Functional programming

BQN boasts of its functional capabilities, including first-class functions. What sort of functional support does it have, and how can a BQN programmer exercise these and out themself as a Schemer at heart?

First, let's be clear about what the terms we're using mean. A language has first-class functions when functions (however they are defined) can be used in all the same ways as "ordinary" values like numbers and so on, such as being passed as an argument or placed in a list. Lisp and JavaScript have first-class functions, C has unsafe first-class functions via function pointers, and Java and APL don't have them as functions can't be placed in lists or used as arguments. This doesn't mean every operation is supported on functions: for instance, numbers can be added, compared, and sorted; while functions could perhaps be added to give a train, comparing or sorting them as functions (not representations) isn't computable, and BQN doesn't support any of the three operations when passing functions as arguments.

diff --git a/docs/doc/group.html b/docs/doc/group.html index 4f3a6b62..8a562285 100644 --- a/docs/doc/group.html +++ b/docs/doc/group.html @@ -1,4 +1,5 @@ +

Group

BQN replaces the Key operator from J or Dyalog APL, and many forms of partitioning, with a single (ambivalent) Group function . This function is somewhat related to the K function = of the same name, but results in an array rather than a dictionary.

The BQN prototype does not implement this function: instead it uses for a Group/Key function very similar to {⊂⍵} in Dyalog APL, and also has a Cut function \. The new BQN Group on numeric arguments (equivalently, rank-1 results) can be defined like this:

diff --git a/docs/doc/index.html b/docs/doc/index.html index a822c0a9..2e873e3c 100644 --- a/docs/doc/index.html +++ b/docs/doc/index.html @@ -1,4 +1,5 @@ +

BQN documentation

Here is the documentation for BQN, describing what features BQN has, how to use them (with examples), and why they were chosen. As it is considerably more in-depth than the specification, the documentation is much less complete. The following pages are present now:

Concepts:

diff --git a/docs/doc/indices.html b/docs/doc/indices.html index 68651b13..5366bdb6 100644 --- a/docs/doc/indices.html +++ b/docs/doc/indices.html @@ -1,4 +1,5 @@ +

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.

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.

diff --git a/docs/doc/join.html b/docs/doc/join.html index 4df484c4..b6ac1ace 100644 --- a/docs/doc/join.html +++ b/docs/doc/join.html @@ -1,4 +1,5 @@ +

Join

Join () is an extension of the monadic function Raze from A+ and J to arbitrary argument ranks. It has the same relationship to Join to, the dyadic function sharing the same glyph, as Merge (>) does to Couple (): ab is >ab and ab is ab. While Merge and Couple combine arrays (the elements of Merge's argument, or the arguments themselves for Couple) along a new leading axis, Join and Join to combine them along the existing leading axis. Both Merge and Join can also be called on a higher-rank array, causing Merge to add multiple leading axes while Join combines elements along multiple existing axes.

Join can be used to combine several strings into a single string, like array.join() in Javascript (but it doesn't force the result to be a string).

diff --git a/docs/doc/logic.html b/docs/doc/logic.html index 2235259a..7ac951d8 100644 --- a/docs/doc/logic.html +++ b/docs/doc/logic.html @@ -1,4 +1,5 @@ +

Logic functions: And, Or, Not (also Span)

BQN retains the APL symbols and for logical and and or, and changed APL's ~ to ¬ for not, since ~ looks too much like ˜ and ¬ is more common in mathematics today. Like J, BQN extends Not to the linear function 1-. However, it discards GCD and LCM as extensions of And and Or, and instead uses bilinear extensions: And is identical to Times (×), while Or is ׬, following De Morgan's laws (other ways of obtaining a function for Or give an equivalent result—there is only one bilinear extension).

If the arguments are probabilities of independent events, then an extended function gives the probability of the boolean function on their outcomes (for example, if A occurs with probability a and B with probability b independent of A, then A or B occurs with probability ab). These extensions have also been used in complexity theory, because they allow mathematicians to transfer a logical circuit from the discrete to the continuous domain in order to use calculus on it.

diff --git a/docs/doc/transpose.html b/docs/doc/transpose.html index 43b51b48..51e8b91a 100644 --- a/docs/doc/transpose.html +++ b/docs/doc/transpose.html @@ -1,4 +1,5 @@ +

Transpose

As in APL, Transpose () is a tool for rearranging the axes of an array. BQN's version is tweaked to align better with the leading axis model and make common operations easier.

Monadic Transpose

diff --git a/docs/doc/windows.html b/docs/doc/windows.html index fa2202dc..79d18e77 100644 --- a/docs/doc/windows.html +++ b/docs/doc/windows.html @@ -1,4 +1,5 @@ +

Windows

In BQN, it's strongly preferred to use functions, and not modifiers, for array manipulation. Functions are simpler as they have fewer moving parts. They are more concrete, since the array results can always be viewed right away. They are easier to implement with reasonable performance as well, since there is no need to recognize many possible function operands as special cases.

The Window function replaces APL's Windowed Reduction, J's more general Infix operator, and Dyalog's Stencil, which is adapted from one case of J's Cut operator.

-- cgit v1.2.3