diff options
Diffstat (limited to 'docs/doc/namespace.html')
| -rw-r--r-- | docs/doc/namespace.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/doc/namespace.html b/docs/doc/namespace.html index a0c06d75..ece4d6b6 100644 --- a/docs/doc/namespace.html +++ b/docs/doc/namespace.html @@ -32,10 +32,10 @@ <span class='Brace'>}</span> </pre> <h2 id="imports"><a class="header" href="#imports">Imports</a></h2> -<p>There are also two ways to get values out of a namespace, such as <code><span class='Value'>example</span></code> defined above. First, it might be used in a destructuring assignment like the one below. This assignment's target looks like a list, where each entry specifies one of the names exported by the block and what it should be assigned to. The element can be either a single name, like <code><span class='Value'>b</span></code>, which gives both, or an aliasing expression like <code><span class='Value'>b2</span><span class='Gets'>⇐</span><span class='Value'>b</span></code>. In this case, the value <code><span class='Value'>b</span></code> from the namespace is used, but it's given the name <code><span class='Value'>b2</span></code> instead of <code><span class='Value'>b</span></code>. Imported names can be repeated—but the variables defined can't—and all the names can be spelled with any role (the role is ignored).</p> +<p>There are also two ways to get values out of a namespace, such as <code><span class='Value'>example</span></code> defined above. First, it might be used in a <a href="expression.html#destructuring">destructuring</a> assignment like the one below. This assignment's target looks like a list, where each entry specifies one of the names exported by the block and what it should be assigned to. The element can be either a single name, like <code><span class='Value'>b</span></code>, which gives both, or an aliasing expression like <code><span class='Value'>b2</span><span class='Gets'>⇐</span><span class='Value'>b</span></code>. In this case, the value <code><span class='Value'>b</span></code> from the namespace is used, but it's given the name <code><span class='Value'>b2</span></code> instead of <code><span class='Value'>b</span></code>. Imported names can be repeated—but the variables defined can't—and all the names can be spelled with any role (the role is ignored).</p> <pre><span class='Bracket'>⟨</span><span class='Value'>alias</span><span class='Gets'>⇐</span><span class='Value'>a</span><span class='Separator'>,</span> <span class='Value'>b</span><span class='Separator'>,</span> <span class='Value'>c0</span><span class='Ligature'>‿</span><span class='Value'>c1</span><span class='Gets'>⇐</span><span class='Value'>c</span><span class='Separator'>,</span> <span class='Value'>b2</span><span class='Gets'>⇐</span><span class='Value'>b</span><span class='Bracket'>⟩</span> <span class='Gets'>←</span> <span class='Value'>example</span> </pre> -<p>If aliasing with <code><span class='Gets'>⇐</span></code> is never used, the names can be given as a strand with <code><span class='Ligature'>‿</span></code>.</p> +<p>If aliasing with <code><span class='Gets'>⇐</span></code> is never used (or each use is parenthesized), the names can be given as a strand with <code><span class='Ligature'>‿</span></code>.</p> <pre><span class='Value'>c</span><span class='Ligature'>‿</span><span class='Value'>a</span> <span class='Gets'>←</span> <span class='Value'>example</span> </pre> <p>The arrows <code><span class='Gets'>⇐</span></code> used for importing don't indicate that the surrounding block is a namespace or export variables. However, a single statement can both import and export, if it's a destructuring assignment and the main assignment arrow is <code><span class='Gets'>⇐</span></code>.</p> |
