aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-08-16 21:21:59 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-08-16 21:24:40 -0400
commit25bf556f9434f557171b040fc2945eacb112ba8c (patch)
tree5663173a187e05f3c1d44b5cbdf19a404aa56991 /doc
parent538a6ab05b070080642e751175425f38f6b33d8e (diff)
Document what programs and errors are
Diffstat (limited to 'doc')
-rw-r--r--doc/glossary.md1
-rw-r--r--doc/syntax.md2
2 files changed, 3 insertions, 0 deletions
diff --git a/doc/glossary.md b/doc/glossary.md
index cd5b1853..7557cc8e 100644
--- a/doc/glossary.md
+++ b/doc/glossary.md
@@ -96,6 +96,7 @@ BQN uses standard terminology for particular sets of numbers, with natural numbe
## Grammar
+* [**Program**](syntax.md): The source code for a single BQN evaluation.
* [**Expression**](syntax.md#expressions): A piece of code that describes the computation of a value.
* [**Nothing**](expression.md#nothing): A special value-like entity that comes from `·`, `𝕨` in a function with no left argument, or a function called on nothing.
* **Statement**: An expression, nothing (`·`), or an export (`var⇐`).
diff --git a/doc/syntax.md b/doc/syntax.md
index 292e6cc9..37d94dc2 100644
--- a/doc/syntax.md
+++ b/doc/syntax.md
@@ -4,6 +4,8 @@
BQN syntax consists of expressions where computation is done, with a little organizing structure around them like assignment, functions, and list notation. Expressions are where the programmer is in control, so the design tries to do as much as possible with them before introducing special syntax.
+A *program* is a unit of source code that's evaluated, such as a source file, or one line of REPL input (one run of the `bqn` executable often involves multiple programs). Like a [block](#blocks), it's a sequence of expressions to be evaluated in order. It has a result, which is used it the program was evaluated from BQN with `•BQN`, `•Import` or similar. An error might occur when a program is running; this ends execution unless it's [caught](assert.md#catch).
+
## Precedence
Here's a full table of precedence for BQN's glyphs (broader than "operator precedence", as an "operator" usually just corresponds to a function). Entries at the bottom make the biggest divisions in the program, while the ones further up are subdivisions.