aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/namespace.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-03-15 15:01:22 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-03-15 15:01:22 -0400
commite858f41dffaee272ffcf4b2cb63a49ad25ebf7d7 (patch)
tree25b625f3b0561702db034495dd2ee1d84f6ec8ef /docs/doc/namespace.html
parent2d094f01f7421a56259433c4b0e86a5f92ba0871 (diff)
Highlight namespace dot as a separate token in md.bqn
Diffstat (limited to 'docs/doc/namespace.html')
-rw-r--r--docs/doc/namespace.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/doc/namespace.html b/docs/doc/namespace.html
index 17ed7cf6..c6f19582 100644
--- a/docs/doc/namespace.html
+++ b/docs/doc/namespace.html
@@ -10,7 +10,7 @@
<p>The following quick example shows a few ways to use a namespace returned by <code><span class='Function'>•Import</span></code>:</p>
<pre><span class='Value'>ns</span> <span class='Gets'>←</span> <span class='Function'>•Import</span> <span class='String'>&quot;file.bqn&quot;</span>
<span class='Bracket'>⟨</span><span class='Value'>something</span><span class='Separator'>,</span> <span class='Value'>abbr</span><span class='Gets'>⇐</span><span class='Value'>abbreviation</span><span class='Bracket'>⟩</span> <span class='Gets'>←</span> <span class='Value'>ns</span> <span class='Comment'># Destructure
-</span><span class='Value'>ns.DoThing</span> <span class='Number'>6</span> <span class='Comment'># Dot syntax
+</span><span class='Value'>ns.</span><span class='Function'>DoThing</span> <span class='Number'>6</span> <span class='Comment'># Dot syntax
</span></pre>
<p>An here's how the contents of file.bqn might look in order to define the variables used above:</p>
<pre><span class='Bracket'>⟨</span><span class='Value'>something</span><span class='Separator'>,</span> <span class='Function'>DoThing</span><span class='Bracket'>⟩</span><span class='Gets'>⇐</span> <span class='Comment'># Declare exports
@@ -42,9 +42,9 @@
<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>
<pre><span class='Bracket'>⟨</span><span class='Value'>two</span><span class='Separator'>,</span> <span class='Value'>vars</span><span class='Bracket'>⟩</span> <span class='Gets'>⇐</span> <span class='Function'>•Import</span> <span class='String'>&quot;stuff.bqn&quot;</span>
</pre>
-<p>The second way to get a value (just one at a time) from a namespace is dot syntax: write the namespace, then a dot <code><span class='Number'>.</span></code>, then another name.</p>
+<p>The second way to get a value (just one at a time) from a namespace is dot syntax: write the namespace, then a dot <code><span class='Value'>.</span></code>, then another name.</p>
<pre><span class='Value'>example.b</span>
-<span class='Brace'>{</span><span class='Value'>n</span><span class='Gets'>⇐</span><span class='Number'>7</span><span class='Brace'>}</span><span class='Number'>.n</span>
+<span class='Brace'>{</span><span class='Value'>n</span><span class='Gets'>⇐</span><span class='Number'>7</span><span class='Brace'>}</span><span class='Value'>.n</span>
</pre>
<p>The syntax is any subject followed by a dot and then a name. This can be chained like <code><span class='Value'>a.b.c</span></code> if a namespace has a value that is also a namespace (and so on).</p>