From a717221a7dd2fb88ff9d5d07e221a83dc558b47d Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 23 Jul 2021 22:49:20 -0400 Subject: Update list notation links --- docs/doc/arrayrepr.html | 1 + docs/doc/context.html | 2 +- docs/doc/control.html | 2 +- docs/doc/fromDyalog.html | 2 +- docs/doc/fromJ.html | 2 +- docs/doc/syntax.html | 3 ++- docs/index.html | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/doc/arrayrepr.html b/docs/doc/arrayrepr.html index aee3ce4a..fa2332c6 100644 --- a/docs/doc/arrayrepr.html +++ b/docs/doc/arrayrepr.html @@ -159,6 +159,7 @@

This case also covers empty lists, which are shown as ⟨⟩. This includes an empty string, as the only difference between an empty string and any other empty list is its fill element and array displays don't depend on the fill.

List literals

+

The tutorial section here also covers this topic.

There are three kinds literal notation for lists: strings, list notation, and stranding. Strings indicate character lists (with space for the fill) and the other two can combine any sequence of elements.

Strings

A string consists of a sequence of characters surrounded by double quotes "". The only rule for the characters inside is that any double quote must be escaped by repeating it twice; otherwise the string ends at that point.

diff --git a/docs/doc/context.html b/docs/doc/context.html index 8c0ea92e..b08f70a0 100644 --- a/docs/doc/context.html +++ b/docs/doc/context.html @@ -59,7 +59,7 @@

The associations between spelling and syntactic role are considered part of BQN's token formation rules.

One rule for typing is also best considered to be a pre-parsing rule like the spelling system: the role of a brace construct {} with no header is determined by which special arguments it uses: it's a subject if there are none, but a 𝕨 or 𝕩 makes it at least a function, an 𝔽 makes it a 1- or 2-modifier, and a 𝔾 always makes it a 2-modifier.

BQN's grammar

-

A formal treatment is included in the spec. BQN's grammar—the ways syntactic roles interact—follows the original APL model (plus trains) closely, with allowances for new features like list notation. In order to keep BQN's syntax context-free, the syntactic role of any expression must be known from its contents, just like tokens.

+

A formal treatment is included in the spec. BQN's grammar—the ways syntactic roles interact—follows the original APL model (plus trains) closely, with allowances for new features like list notation. In order to keep BQN's syntax context-free, the syntactic role of any expression must be known from its contents, just like tokens.

Here is a table of the APL-derived modifier and function application rules:

diff --git a/docs/doc/control.html b/docs/doc/control.html index ad6c65f8..9dc6e2a8 100644 --- a/docs/doc/control.html +++ b/docs/doc/control.html @@ -185,7 +185,7 @@ }

The initialization can be a simple expression as shown; in fact it's a little silly to make initialization one of the arguments to For at all.Unlike in C, it's impossible to declare a variable that's local to the whole For loop but not its surroundings. Hopefully this is obvious from the structure of the code! Only curly braces can create a new scope, so to localize some variables in the For loop, just surround it in an extra set of curly braces.

-

The While loop alone allows syntax similar to the For loop. Perform any initialization outside of the loop, and compose the post-action with the main body using the reverse composition {𝔾𝔽}. Because the composition binds less tightly than stranding, the bracketed list notation has to be used here.

+

The While loop alone allows syntax similar to the For loop. Perform any initialization outside of the loop, and compose the post-action with the main body using the reverse composition {𝔾𝔽}. Because the composition binds less tightly than stranding, the bracketed list notation has to be used here.

c27  n0
 While {𝕤1<c}, {𝕤n+1}{𝔾𝔽}{𝕤
   Match (2|c){
diff --git a/docs/doc/fromDyalog.html b/docs/doc/fromDyalog.html
index d213dbb5..4568fd31 100644
--- a/docs/doc/fromDyalog.html
+++ b/docs/doc/fromDyalog.html
@@ -108,7 +108,7 @@
 

BQN doesn't have guards: it uses modifiers or control structures instead. However, BQN function and modifier blocks have headers that allow pattern matching. See the block documentation.

The assignment arrow defines a new variable in a block, while modifies an existing one.

-

BQN uses the ligature character for stranding, instead of plain juxtaposition. It also has a list notation using ⟨⟩.

+

BQN uses the ligature character for stranding, instead of plain juxtaposition. It also has a list notation using ⟨⟩.

For reading

Here are some closest equivalents in Dyalog APL for the BQN functions that don't use the same glyphs as APL. Correspondence can be approximate, and is just used as a decorator to mean "reverse some things".

diff --git a/docs/doc/fromJ.html b/docs/doc/fromJ.html index e5407e07..3dcb7473 100644 --- a/docs/doc/fromJ.html +++ b/docs/doc/fromJ.html @@ -107,7 +107,7 @@
-

BQN's explicit functions and modifiers are called "blocks", and have a more sophisticated syntax than J; see the documentation. BQN uses lexical scope, and has no global variables. BQN also has a list notation using ⟨⟩.

+

BQN's explicit functions and modifiers are called "blocks", and have a more sophisticated syntax than J; see the documentation. BQN uses lexical scope, and has no global variables. BQN also has a list notation using ⟨⟩.

For reading

J analogues of BQN primitive functions are given below. They are not always the same; usually this is because BQN has extra functionality relative to J, although in some cases it has less or different functionality.

Functions + - | < > are the same in both languages.

diff --git a/docs/doc/syntax.html b/docs/doc/syntax.html index c22de4f6..1eab4d0c 100644 --- a/docs/doc/syntax.html +++ b/docs/doc/syntax.html @@ -137,7 +137,7 @@

BQN's built-in operations also have patterns to indicate the syntactic role: 1-modifiers (˜¨˘⁼⌜´`) are all superscript characters, and 2-modifiers (∘○⊸⟜⌾⊘◶⚇⎉⍟) all have an unbroken circle (two functions ⌽⍉ have broken circles with lines through them). Every other built-in constant is a function, although the special symbols ¯, , and π are used as part of numeric literal notation.

Assignment

-

Another element that can be included in expressions is assignment, which is written with to define (also called "declare" in many other languages) a variable and to change its definition. A variable can only be defined once within a scope, and can only be changed if it has already been defined. However, it can be shadowed, meaning that it is defined again in an inner scope even though it has a definition in an outer scope already.

+

Another element that can be included in expressions is assignment, which is written with to define (also called "declare" in many other languages) a variable and to change its definition. A variable can only be defined once within a scope, and can only be changed if it has already been defined. However, it can be shadowed, meaning that it is defined again in an inner scope even though it has a definition in an outer scope already.

↗️
    x1  {x2  x3  x}
 3
     x
@@ -163,6 +163,7 @@
 

Separators

The characters and , and newline are completely interchangeable and are used to separate expressions. An expression might be an element in a list or a line in a function. Empty sections—those that consist only of whitespace—are ignored. This means that any number of separators can be used between expressions, and that leading and trailing separators are also allowed. The expressions are evaluated in text order: left to right and top to bottom.

List notation

+

Full documentation

Lists (1-dimensional arrays) are enclosed in angle brackets ⟨⟩, with the results of the expressions in between being the list's elements. Lists of two elements or more can also be written with the ligature character . This character has higher binding strength than any part of an expression. If one of the elements is a compound expression, then it will need to be enclosed in parentheses.

Blocks

Full documentation

diff --git a/docs/index.html b/docs/index.html index b22d6707..7a23a015 100644 --- a/docs/index.html +++ b/docs/index.html @@ -36,7 +36,7 @@

But BQN is redesigned from the ground up, with brand new ideas to make these paradigms easier to use and less likely to fail.