diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-11-22 17:57:14 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-11-22 17:57:14 -0500 |
| commit | 3100d6b64d886b138ce3866df561057651371818 (patch) | |
| tree | 914de38e97b7cf6d80216f1bbe521bbc67e2e48a /docs/spec/system.html | |
| parent | 0c0e70ece0b6411942ed6fb735fed6b900ad32a0 (diff) | |
Specify •SH
Diffstat (limited to 'docs/spec/system.html')
| -rw-r--r-- | docs/spec/system.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/spec/system.html b/docs/spec/system.html index 359e64bc..41b98728 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -312,6 +312,22 @@ </table> <p><code><span class='Function'>•Out</span></code> prints a string to stdout, with a trailing newline. <code><span class='Function'>•Show</span></code> displays a BQN value to the programmer (the representation is not specified, and does not need to be plain text). <code><span class='Function'>•Fmt</span></code> returns a string (not a character table: lines are separated by linefeeds) indicating how <code><span class='Value'>𝕩</span></code> would be printed by the interactive environment. Both <code><span class='Function'>•Show</span></code> and <code><span class='Function'>•Fmt</span></code> may take a left argument configuring how the value should be formatted.</p> <p><code><span class='Function'>•Repr</span></code> attempts to return a string so that <code><span class='Function'>•BQN</span> <span class='Function'>•Repr</span> <span class='Value'>𝕩</span></code> matches <code><span class='Value'>𝕩</span></code>. If <code><span class='Value'>𝕩</span></code> contains any mutable values (operations or namespaces), this is not possible. However, if such a values is stateless, in the sense that they don't access variables outside of their own scopes, it is permissible for <code><span class='Function'>•Repr</span></code> to return source code that would create a value with identical behavior.</p> +<h2 id="interface"><a class="header" href="#interface">Interface</a></h2> +<table> +<thead> +<tr> +<th>Name</th> +<th>Summary</th> +</tr> +</thead> +<tbody> +<tr> +<td><code><span class='Function'>•SH</span></code></td> +<td>Execute shell command and return <code><span class='Value'>exitcode</span><span class='Ligature'>‿</span><span class='Value'>stdout</span><span class='Ligature'>‿</span><span class='Value'>stderr</span></code></td> +</tr> +</tbody> +</table> +<p>The argument to <code><span class='Function'>•SH</span></code> is a list of strings giving the command and its arguments (for example <code><span class='String'>"mv"</span><span class='Ligature'>‿</span><span class='String'>"old"</span><span class='Ligature'>‿</span><span class='String'>"new"</span></code>). The command is executed synchronously, and the result is a list of three elements: the command's exit code, text written to stdout, and text written to stderr. In both cases the text is a plain string containing all text emitted by the program. Text is interpreted as UTF-8, with an error if it's not valid UTF-8.</p> <h2 id="operation-properties"><a class="header" href="#operation-properties">Operation properties</a></h2> <table> <thead> |
