aboutsummaryrefslogtreecommitdiff
path: root/docs/tutorial/list.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-02 14:58:08 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-02 15:06:12 -0500
commitc3ca745d472c6dd8fb54c023f1922bc9805b48d2 (patch)
tree3ec7976c318ff8eb03884022e4e8e4e142f33d2f /docs/tutorial/list.html
parent55c40e75dde0ddad39a305f29e036ec88c85babe (diff)
Include trailing newline in ERROR for code blocks
Diffstat (limited to 'docs/tutorial/list.html')
-rw-r--r--docs/tutorial/list.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/tutorial/list.html b/docs/tutorial/list.html
index 4d867329..05e4b9c5 100644
--- a/docs/tutorial/list.html
+++ b/docs/tutorial/list.html
@@ -335,7 +335,8 @@
</pre>
<p>Multiplication is harder, and if we try to multiply by the place value list directly it doesn't go so well.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KOKMvTLii4bihpU4KSDDlyAnMCcgLcucICIwMTAwMTExMCLigL8iMDExMDAxMDEi4oC/IjAxMTEwMDEwIuKAvyIwMTEwMDEwMCLigL8iMDAxMDAwMDEi">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>⌽</span><span class='Number'>2</span><span class='Function'>⋆↕</span><span class='Number'>8</span><span class='Paren'>)</span> <span class='Function'>×</span> <span class='String'>'0'</span> <span class='Function'>-</span><span class='Modifier'>˜</span> <span class='String'>&quot;01001110&quot;</span><span class='Ligature'>‿</span><span class='String'>&quot;01100101&quot;</span><span class='Ligature'>‿</span><span class='String'>&quot;01110010&quot;</span><span class='Ligature'>‿</span><span class='String'>&quot;01100100&quot;</span><span class='Ligature'>‿</span><span class='String'>&quot;00100001&quot;</span>
-ERROR</pre>
+ERROR
+</pre>
<p>This is because the list on the left has length 8 while the list on the right has length 5. The <em>elements</em> of the list on the right have length 8, but BQN can't be expected to know you want to connect the two arguments in that particular way. Especially considering that if you happen to have 8 characters then the right argument <em>will</em> have length 8!</p>
<p>There are a few ways to handle this. What we'll do is <em>bind</em> the place values to <code><span class='Function'>×</span></code> using the 2-modifier <code><span class='Modifier2'>⊸</span></code>. This modifier attaches a left argument to a function.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=ImFiIiDiiL7CqCDin6ggImNkIiwgInV0IiDin6kKCiJhYiLiirjiiL7CqCDin6ggImNkIiwgInV0IiDin6k=">↗️</a><pre> <span class='String'>&quot;ab&quot;</span> <span class='Function'>∾</span><span class='Modifier'>¨</span> <span class='Bracket'>⟨</span> <span class='String'>&quot;cd&quot;</span><span class='Separator'>,</span> <span class='String'>&quot;ut&quot;</span> <span class='Bracket'>⟩</span>