diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-03-04 22:00:26 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-03-04 22:52:08 -0500 |
| commit | 681f958f0d9dfbcd1f42753557a1a729c384ca52 (patch) | |
| tree | f7455cad088becc593707a8890c915b8d63a92b9 | |
| parent | d34d752220f645b253c722bd39e479452ed36e41 (diff) | |
Add •Eval, •Using, and •Fmt to spec
| -rw-r--r-- | docs/spec/system.html | 28 | ||||
| -rw-r--r-- | spec/system.md | 11 |
2 files changed, 39 insertions, 0 deletions
diff --git a/docs/spec/system.html b/docs/spec/system.html index 64a43ce6..fead3b97 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -69,6 +69,30 @@ <li>Lines: BQN strings. The file is decoded as with chars, then split into lines by CR, LR, or CRLF line endings.</li> <li>Bytes: Single-byte values, stored as BQN characters from <code><span class='String'>@</span></code> to <code><span class='String'>@</span><span class='Function'>+</span><span class='Number'>255</span></code>.</li> </ul> +<h2 id="execution-and-scope-manipulation">Execution and scope manipulation</h2> +<table> +<thead> +<tr> +<th>Name</th> +<th>Summary</th> +</tr> +</thead> +<tbody> +<tr> +<td><code><span class='Function'>•BQN</span></code></td> +<td>Evaluate the argument string in an isolated scope</td> +</tr> +<tr> +<td><code><span class='Function'>•Eval</span></code></td> +<td>Evaluate the argument string in the current scope</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 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> <h2 id="input-and-output">Input and output</h2> <table> <thead> @@ -82,6 +106,10 @@ <td><code><span class='Function'>•Out</span></code></td> <td>Print argument string</td> </tr> +<tr> +<td><code><span class='Function'>•Fmt</span></code></td> +<td>Format value for printing</td> +</tr> </tbody> </table> <h2 id="operation-properties">Operation properties</h2> diff --git a/spec/system.md b/spec/system.md index 827af981..10d643ef 100644 --- a/spec/system.md +++ b/spec/system.md @@ -41,11 +41,22 @@ Functions `•FChars`, `•FLines`, and `•FBytes` are all ambivalent. If only - Lines: BQN strings. The file is decoded as with chars, then split into lines by CR, LR, or CRLF line endings. - Bytes: Single-byte values, stored as BQN characters from `@` to `@+255`. +## Execution and scope manipulation + +| Name | Summary +|------------|-------------------------- +| `•BQN` | Evaluate the argument string in an isolated scope +| `•Eval` | Evaluate the argument string in the current scope +| `•Using` | Import all values from the argument namespace + +The effect of `•Eval` should be the same as if its argument were written as source code in the scope where `•Eval` appears. It can define variables, and modify those in the current scope or a parent. + ## Input and output | Name | Summary |--------|---------------------- | `•Out` | Print argument string +| `•Fmt` | Format value for printing ## Operation properties |
