aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-11-12 21:22:50 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-11-12 21:22:50 -0500
commit0ec4444d361f530e2733345cb0d0dbe530ec0860 (patch)
tree0e1e10110c0e0423930b8cc1bd17b09a97b930e4 /spec
parentf6c8a4954230737321e6eeedd07b7a356b8bee36 (diff)
Spec off-by-one-in-each-letter-sort-of error
Diffstat (limited to 'spec')
-rw-r--r--spec/evaluate.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/evaluate.md b/spec/evaluate.md
index dccf902d..7ddbb616 100644
--- a/spec/evaluate.md
+++ b/spec/evaluate.md
@@ -14,7 +14,7 @@ As specified, BQN programs can involve an arbitrary amount of information, but w
The result of parsing a valid BQN program is a `PROGRAM`, and the program is run by evaluating this term.
-A `PROGRAM` or `BODY` is a list of `STMT`s, which are evaluated in program order. A result is always required for `BODY` nodes, and sometimes for `PROGRAM` nodes (for example, when loaded with `•Import`). If any identifiers in the node's scope are exported, or any of its statements is an `EXPORT`, then the result is the namespace created in order to evaluate the node. If a result is required but the namespace case doesn't apply, then the last `STMT` node must be an `EXPR` and its result is used. The statement `EXPR` evaluates some APL code and possibly assigns the results, while `nothing` evaluates any `subject` or `Derv` terms it contains but discards the results. An `EXPORT` statement performs no action.
+A `PROGRAM` or `BODY` is a list of `STMT`s, which are evaluated in program order. A result is always required for `BODY` nodes, and sometimes for `PROGRAM` nodes (for example, when loaded with `•Import`). If any identifiers in the node's scope are exported, or any of its statements is an `EXPORT`, then the result is the namespace created in order to evaluate the node. If a result is required but the namespace case doesn't apply, then the last `STMT` node must be an `EXPR` and its result is used. The statement `EXPR` evaluates some BQN code and possibly assigns the results, while `nothing` evaluates any `subject` or `Derv` terms it contains but discards the results. An `EXPORT` statement performs no action.
A block consists of several `BODY` terms, some of which may have an accompanying header describing accepted inputs and how they are processed. An immediate block `brImm` can only have one `BODY`, and is evaluated by evaluating the code in it. Other types of blocks do not evaluate any `BODY` immediately, but instead return a function or modifier that obtains its result by evaluating a particular `BODY`. The `BODY` is identified and evaluated once the block has received enough inputs (operands or arguments), which for modifiers can take one or two calls: if two calls are required, then on the first call the operands are simply stored and no code is evaluated yet. The stored values can be accessed by equality checking, or `•Decompose` if defined. Two calls are required if there is more than one `BODY` term, if the `BODY` contains the special names `𝕨𝕩𝕤𝕎𝕏𝕊`, or if its header specifies arguments (the header-body combination is a `_mCase` or `_cCase_`). Otherwise only one is required.