aboutsummaryrefslogtreecommitdiff
path: root/docs/spec
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-24 11:00:52 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-24 11:00:52 -0400
commit9bccc26a0c3231d7cc9adc37c1a850ef44fd436a (patch)
treed9ee03b98126b14423af4d07ae4fd7d84589f1aa /docs/spec
parent3863c3837ded859328243ae42f524c45741c872e (diff)
Add breadcrumbs to generated html
Diffstat (limited to 'docs/spec')
-rw-r--r--docs/spec/evaluate.html2
-rw-r--r--docs/spec/grammar.html2
-rw-r--r--docs/spec/index.html2
-rw-r--r--docs/spec/inferred.html4
-rw-r--r--docs/spec/literal.html2
-rw-r--r--docs/spec/scope.html2
-rw-r--r--docs/spec/token.html2
-rw-r--r--docs/spec/types.html2
8 files changed, 9 insertions, 9 deletions
diff --git a/docs/spec/evaluate.html b/docs/spec/evaluate.html
index bfe9cbef..ab2b6bf4 100644
--- a/docs/spec/evaluate.html
+++ b/docs/spec/evaluate.html
@@ -3,7 +3,7 @@
<link href="../style.css" rel="stylesheet"/>
<title>Specification: BQN evaluation</title>
</head>
-<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div>
<h1 id="specification-bqn-evaluation">Specification: BQN evaluation</h1>
<p>This page describes the semantics of the code constructs whose grammar is given in <a href="grammar.html">grammar.md</a>. The formation rules there are not named, and here they are identified by either the name of the term or by copying the rule entirely if there are several alternative productions.</p>
<p>Here we assume that the referent of each identifier, or equivalently the connections between identifiers, have been identified according to the <a href="scope.html">scoping rules</a>.</p>
diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html
index 4928aed8..66734fc4 100644
--- a/docs/spec/grammar.html
+++ b/docs/spec/grammar.html
@@ -3,7 +3,7 @@
<link href="../style.css" rel="stylesheet"/>
<title>Specification: BQN grammar</title>
</head>
-<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div>
<h1 id="specification-bqn-grammar">Specification: BQN grammar</h1>
<p>BQN's grammar is given below. Terms are defined in a <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form">BNF</a> variant. However, handling special names properly is possible but difficult in BNF, so they are explained in text along with the braced block grammar.</p>
<p>The symbols <code><span class='Value'>s</span></code>, <code><span class='Function'>F</span></code>, <code><span class='Modifier'>_m</span></code>, and <code><span class='Modifier2'>_c_</span></code> are identifier tokens with subject, function, 1-modifier, and 2-modifier classes respectively. Similarly, <code><span class='Value'>sl</span></code>, <code><span class='Function'>Fl</span></code>, <code><span class='Modifier'>_ml</span></code>, and <code><span class='Modifier2'>_cl_</span></code> refer to literals and primitives of those classes. While names in the BNF here follow the identifier naming scheme, this is informative only: syntactic classes are no longer used after parsing and cannot be inspected in a running program.</p>
diff --git a/docs/spec/index.html b/docs/spec/index.html
index 8a7d2a69..3d9ae69a 100644
--- a/docs/spec/index.html
+++ b/docs/spec/index.html
@@ -3,7 +3,7 @@
<link href="../style.css" rel="stylesheet"/>
<title>BQN specification</title>
</head>
-<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a></div>
<h1 id="bqn-specification">BQN specification</h1>
<p>This directory gives a (currently incomplete) specification for BQN. The specification differs from the <a href="../doc/index.html">documentation</a> in that its purpose is only to describe the exact details of BQN's operation in the most quickly accessible way, rather than to explain the core ideas of BQN functionality and how it might be used. Since it is easier to specify than to document, the specification is currently more complete than the documentation; for example, it includes nearly all primitives.</p>
<p>The following aspects define BQN and are or will be specified:</p>
diff --git a/docs/spec/inferred.html b/docs/spec/inferred.html
index 7dc99db6..f01450ea 100644
--- a/docs/spec/inferred.html
+++ b/docs/spec/inferred.html
@@ -3,7 +3,7 @@
<link href="../style.css" rel="stylesheet"/>
<title>Specification: BQN inferred properties</title>
</head>
-<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div>
<h1 id="specification-bqn-inferred-properties">Specification: BQN inferred properties</h1>
<p>BQN includes some simple deductive capabilities: detecting the type of empty array elements, and the Undo (<code><span class='Modifier'>⁼</span></code>) and Under (<code><span class='Modifier2'>⌾</span></code>) modifiers. These tasks are a kind of proof-based or constraint programming, and can never be solved completely (some instances will be undecidable) but can be solved in more instances by ever-more sophisticated algorithms. To allow implementers to develop more advanced implementations while offering some stability and portability to programmers, two kinds of specification are given here. First, constraints are given on the behavior of inferred properties. These are not exact and require some judgment on the part of the implementer. Second, behavior for common or useful cases is specified more precisely. Non-normative suggestions are also given as a reference for implementers.</p>
<p>For the specified cases, the given functions and modifiers refer to those particular representations. It is not necessary to detect equivalent representations, for example to reduce <code><span class='Paren'>(</span><span class='Function'>+-×</span><span class='Paren'>)</span><span class='Modifier'>⁼</span></code> to <code><span class='Function'>∨</span><span class='Modifier'>⁼</span></code>. However, it is necessary to identify computed functions and modifiers: for example <code><span class='Function'>F</span><span class='Modifier'>⁼</span></code> when the value of <code><span class='Function'>F</span></code> in the expression is <code><span class='Function'>∨</span></code>, or <code><span class='Paren'>(</span><span class='Number'>1</span><span class='Function'>⊑∧</span><span class='Ligature'>‿</span><span class='Function'>∨</span><span class='Paren'>)</span><span class='Modifier'>⁼</span></code>.</p>
@@ -44,7 +44,7 @@
</tr>
<tr>
<td><code><span class='Function'>√</span></code></td>
-<td><code><span class='Function'>⋆</span><span class='Modifier2'>⟜</span><span class='Number'>2</span></code></td>
+<td><code><span class='Function'>×</span><span class='Modifier'>˜</span></code></td>
<td><code><span class='Function'>⋆</span><span class='Modifier'>˜</span></code></td>
</tr>
<tr>
diff --git a/docs/spec/literal.html b/docs/spec/literal.html
index 39ac864a..c9e9d362 100644
--- a/docs/spec/literal.html
+++ b/docs/spec/literal.html
@@ -3,7 +3,7 @@
<link href="../style.css" rel="stylesheet"/>
<title>Specification: BQN literal notation</title>
</head>
-<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div>
<h1 id="specification-bqn-literal-notation">Specification: BQN literal notation</h1>
<p>A <em>literal</em> is a single <a href="token.html">token</a> that indicates a fixed character, number, or array. While literals indicate values of a data type, <a href="primitive.html">primitives</a> indicate values of an operation type: function, 1-modifier, or 2-modifier.</p>
<p>Two types of literal deal with text. As the source code is considered to be a sequence of unicode code points (&quot;characters&quot;), and these code points are also used for BQN's character <a href="types.html">data type</a>, the representation of a text literal is very similar to its value. In a text literal, the newline character is always represented using the ASCII line feed character, code point 10. A <em>character literal</em> is enclosed with single quotes <code><span class='String'>'</span></code> and its value is identical to the single character between them. A <em>string literal</em> is enclosed in double quotes <code><span class='String'>&quot;</span></code>, and any double quotes between them must come in pairs, as a lone double quote marks the end of the literal. The value of a string literal is a rank-1 array whose elements are the characters in between the enclosing quotes, after replacing each pair of double quotes with only one such quote. The <em>null literal</em> is the token <code><span class='String'>@</span></code> and represents the null character, code point 0.</p>
diff --git a/docs/spec/scope.html b/docs/spec/scope.html
index 95bb16c1..6e8dd6ac 100644
--- a/docs/spec/scope.html
+++ b/docs/spec/scope.html
@@ -3,7 +3,7 @@
<link href="../style.css" rel="stylesheet"/>
<title>Specification: BQN variable scoping</title>
</head>
-<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div>
<h1 id="specification-bqn-variable-scoping">Specification: BQN variable scoping</h1>
<p>BQN uses lexical scoping for variables, where scopes correspond roughly to blocks, or pairs of curly braces separated by semicolons. At the top level in a scope, new variables are visible only after they are defined, but in the scopes it contains, all variables defined in that scope are visible. This system is specified more precisely below.</p>
<p>A running BQN program manipulates variables during its <a href="evaluate.html">execution</a>, but it is important to distinguish these variables from the identifiers that refer to them. As defined in the <a href="token.html">tokenization rules</a>, an identifier is a particular kind of token found in a program's source code. The lexical scoping rules in this page define which identifiers are considered the same; these identifiers will refer to the same variables when the program is run. While each variable has only one identifier, an identifier can refer to any number of variables because a new variable is created for that identifier each time its containing scope is instantiated (that is, each time the contents of the block are evaluated).</p>
diff --git a/docs/spec/token.html b/docs/spec/token.html
index 87e738ac..799ae387 100644
--- a/docs/spec/token.html
+++ b/docs/spec/token.html
@@ -3,7 +3,7 @@
<link href="../style.css" rel="stylesheet"/>
<title>Specification: BQN token formation</title>
</head>
-<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div>
<h1 id="specification-bqn-token-formation">Specification: BQN token formation</h1>
<p>This page describes BQN's token formation rules (token formation is also called scanning). Most tokens in BQN are a single character long, but quoted characters and strings, identifiers, and numbers can consist of multiple characters, and comments, spaces, and tabs are discarded during token formation.</p>
<p>BQN source code should be considered as a series of unicode code points, which we refer to as &quot;characters&quot;. The separator between lines in a file is considered to be a single character, newline, even though some operating systems such as Windows typically represent it with a two-character CRLF sequence. Implementers should note that not all languages treat unicode code points as atomic, as exposing the UTF-8 or UTF-16 representation instead is common. For a language such as JavaScript that uses UTF-16, the double-struck characters <code><span class='Value'>𝕨</span><span class='Function'>𝕎</span><span class='Value'>𝕩</span><span class='Function'>𝕏</span><span class='Value'>𝕗</span><span class='Function'>𝔽</span><span class='Value'>𝕘</span><span class='Function'>𝔾</span></code> are represented as two 16-bit surrogate characters, but BQN treats them as a single unit.</p>
diff --git a/docs/spec/types.html b/docs/spec/types.html
index 13345808..8c9c694a 100644
--- a/docs/spec/types.html
+++ b/docs/spec/types.html
@@ -3,7 +3,7 @@
<link href="../style.css" rel="stylesheet"/>
<title>Specification: BQN types</title>
</head>
-<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div>
<h1 id="specification-bqn-types">Specification: BQN types</h1>
<p>BQN programs manipulate data of six types:</p>
<ul>