diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-23 07:20:55 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-23 07:20:55 -0400 |
| commit | 68a6d369290859aa3188c79ed7d73db58e9ac234 (patch) | |
| tree | dae4466db13ed0c9864f39c41e96efa7241d962c /docs | |
| parent | c8fd5abe3abad1251ce438d3dd3e640acde8990f (diff) | |
Specification for •MakeREPL, •state, and evaluation left arguments
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/spec/system.html | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/spec/system.html b/docs/spec/system.html index e95be2ab..d4b56cf4 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -30,11 +30,16 @@ <td>Evaluate the argument string in a child scope</td> </tr> <tr> +<td><code><span class='Function'>•MakeREPL</span></code></td> +<td>Create an evaluator that keeps variables across runs</td> +</tr> +<tr> <td><code><span class='Function'>•Using</span></code></td> <td>Import all values from the argument namespace</td> </tr> </tbody> </table> +<p>The left argument to any evaluator (<code><span class='Function'>•BQN</span></code>, <code><span class='Function'>•Eval</span></code>, <code><span class='Function'>•ScopedEval</span></code>, result of <code><span class='Function'>•MakeREPL</span></code>), if given, is a list of up to three elements, giving a prefix of <code><span class='Value'>•state</span></code> (see next section) during evaluations of that function. Thus <code><span class='Bracket'>⟨</span><span class='String'>""</span><span class='Separator'>,</span><span class='String'>"xyz"</span><span class='Bracket'>⟩</span><span class='Function'>•BQN</span><span class='String'>"•name"</span></code> returns <code><span class='String'>"xyz"</span></code>.</p> <p>The effect of <code><span class='Function'>•Eval</span></code> should be the same as if its argument were written as source code in the scope where <code><span class='Function'>•Eval</span></code> appears. It can define variables, and modify those in the current scope or a parent.</p> <p><code><span class='Function'>•ScopedEval</span></code> creates as new scope for evaluation as it is loaded. Other than its syntactic role, it is effectively equivalent to <code><span class='Brace'>{</span><span class='Function'>•Eval</span><span class='Brace'>}</span></code>. Parent scopes are visible from the created scope; to make a scope without this property use <code><span class='Function'>•BQN</span><span class='String'>"•Eval"</span></code> or <code><span class='Function'>•BQN</span><span class='String'>"•ScopedEval"</span></code>.</p> <h2 id="scripts"><a class="header" href="#scripts">Scripts</a></h2> @@ -51,6 +56,10 @@ <td>Load a script file</td> </tr> <tr> +<td><code><span class='Value'>•state</span></code></td> +<td><code><span class='Bracket'>⟨</span><span class='Value'>•path</span><span class='Separator'>,</span> <span class='Value'>•name</span><span class='Separator'>,</span> <span class='Value'>•args</span><span class='Bracket'>⟩</span></code></td> +</tr> +<tr> <td><code><span class='Value'>•args</span></code></td> <td>Arguments passed to current file</td> </tr> |
