aboutsummaryrefslogtreecommitdiff
path: root/docs/doc
diff options
context:
space:
mode:
Diffstat (limited to 'docs/doc')
-rw-r--r--docs/doc/block.html2
-rw-r--r--docs/doc/functional.html4
-rw-r--r--docs/doc/syntax.html2
3 files changed, 4 insertions, 4 deletions
diff --git a/docs/doc/block.html b/docs/doc/block.html
index 21354448..10896e93 100644
--- a/docs/doc/block.html
+++ b/docs/doc/block.html
@@ -94,7 +94,7 @@
</pre>
<p>However, <code><span class='Nothing'>Β·</span></code> can only be used as an argument, and not a list element or operand. Don't use <code><span class='Value'>𝕨</span></code> in these ways in a function that could be called monadically. Another potential issue is that <code><span class='Modifier2'>⊸</span></code> and <code><span class='Modifier2'>⟜</span></code> don't work the way you might expect.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=eyDwnZWoIOKLhuKKuC0g8J2VqSB9IDU=">↗️</a><pre> <span class='Brace'>{</span> <span class='Value'>𝕨</span> <span class='Function'>⋆</span><span class='Modifier2'>⊸</span><span class='Function'>-</span> <span class='Value'>𝕩</span> <span class='Brace'>}</span> <span class='Number'>5</span>
-143.413159102577
+143.4131591025766
</pre>
<p>Called dyadically, this function will expand to <code><span class='Paren'>(</span><span class='Function'>⋆</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>-</span><span class='Value'>𝕩</span></code>, so we might expect the monadic result to be <code><span class='Function'>-</span><span class='Value'>𝕩</span></code>. This sort of expansion isn't right with <code><span class='Nothing'>Β·</span></code> on the left. <code><span class='Function'>⋆</span><span class='Modifier2'>⊸</span><span class='Function'>-</span></code> taken as a whole is a function, so <code><span class='Nothing'>Β·</span> <span class='Function'>⋆</span><span class='Modifier2'>⊸</span><span class='Function'>-</span> <span class='Value'>𝕩</span></code> is just <code><span class='Function'>⋆</span><span class='Modifier2'>⊸</span><span class='Function'>-</span> <span class='Value'>𝕩</span></code>, or <code><span class='Paren'>(</span><span class='Function'>⋆</span><span class='Value'>𝕩</span><span class='Paren'>)</span><span class='Function'>-</span><span class='Value'>𝕩</span></code>, giving the large result seen above.</p>
<h3 id="operands">Operands</h3>
diff --git a/docs/doc/functional.html b/docs/doc/functional.html
index 7debbe20..76dc6777 100644
--- a/docs/doc/functional.html
+++ b/docs/doc/functional.html
@@ -111,11 +111,11 @@
<p>Like any function, this one can be given a name and then called. A quirk of this way of defining a function is that it has a subject role (it's the result of the function <code><span class='Brace'>{</span><span class='Function'>π•Ž</span><span class='Modifier2'>∘</span><span class='Function'>𝕏</span><span class='Brace'>}</span><span class='Modifier'>Β΄</span></code>) and so must be defined with a lowercase name.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=Z2F1c3Mg4oaQIHvwnZWO4oiY8J2Vj33CtCDii4bigL8t4oC/KMOXy5wpCkdhdXNzIDI=">↗️</a><pre> <span class='Value'>gauss</span> <span class='Gets'>←</span> <span class='Brace'>{</span><span class='Function'>π•Ž</span><span class='Modifier2'>∘</span><span class='Function'>𝕏</span><span class='Brace'>}</span><span class='Modifier'>Β΄</span> <span class='Function'>⋆</span><span class='Ligature'>β€Ώ</span><span class='Function'>-</span><span class='Ligature'>β€Ώ</span><span class='Paren'>(</span><span class='Function'>Γ—</span><span class='Modifier'>˜</span><span class='Paren'>)</span>
<span class='Function'>Gauss</span> <span class='Number'>2</span>
-0.0183156388887342
+0.01831563888873418
</pre>
<p>Another, and probably more common, use of arrays of functions is to apply several different functions to one or more arguments. Here we apply three different functions to the number 9:</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4p+o4oiaLCAy4oq44oi+LCDiiqIt4ouG4p+pIHvwnZWO8J2VqX3CqCA5">↗️</a><pre> <span class='Bracket'>⟨</span><span class='Function'>√</span><span class='Separator'>,</span> <span class='Number'>2</span><span class='Modifier2'>⊸</span><span class='Function'>∾</span><span class='Separator'>,</span> <span class='Function'>⊒-⋆</span><span class='Bracket'>⟩</span> <span class='Brace'>{</span><span class='Function'>π•Ž</span><span class='Value'>𝕩</span><span class='Brace'>}</span><span class='Modifier'>Β¨</span> <span class='Number'>9</span>
-⟨ 3 ⟨ 2 9 ⟩ ¯8094.08392757538 ⟩
+⟨ 3 ⟨ 2 9 ⟩ ¯8094.083927575384 ⟩
</pre>
<p>The 2-modifier Choose (<code><span class='Modifier2'>β—Ά</span></code>) relies on arrays of functions to… function. It's very closely related to Pick <code><span class='Function'>βŠ‘</span></code>, and in fact when the left operand and the elements of the right operand are all data there's no real difference: Choose returns the constant function <code><span class='Value'>𝕗</span><span class='Function'>βŠ‘</span><span class='Value'>π•˜</span></code>.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MuKXtiJhYmNkZWYiICJhcmci">↗️</a><pre> <span class='Number'>2</span><span class='Modifier2'>β—Ά</span><span class='String'>&quot;abcdef&quot;</span> <span class='String'>&quot;arg&quot;</span>
diff --git a/docs/doc/syntax.html b/docs/doc/syntax.html
index 4f8eb345..88e006fc 100644
--- a/docs/doc/syntax.html
+++ b/docs/doc/syntax.html
@@ -108,7 +108,7 @@
<p>BQN has single-token notation for numbers, strings, and characters.</p>
<p>Numbers allow the typical decimal notation with <code><span class='Number'>Β―</span></code> for the negative sign (because <code><span class='Function'>-</span></code> is a function) and <code><span class='Value'>e</span></code> for scientific notation (or <code><span class='Function'>E</span></code>, as numeric notation is case-insensitive). <code><span class='Number'>∞</span></code> and <code><span class='Number'>Ο€</span></code> may be used as special numeric values. If complex numbers are supported, then they can be written with the components separated by <code><span class='Value'>i</span></code>. However, no BQN to date supports complex numbers.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4p+oIMKvz4Ag4ouEIDAuNSDii4QgNWXCrzEg4ouEIDEuNUUzIOKLhCDiiJ4g4p+pICAgIyBBIGxpc3Qgb2YgbnVtYmVycw==">↗️</a><pre> <span class='Bracket'>⟨</span> <span class='Number'>Β―Ο€</span> <span class='Separator'>β‹„</span> <span class='Number'>0.5</span> <span class='Separator'>β‹„</span> <span class='Number'>5eΒ―1</span> <span class='Separator'>β‹„</span> <span class='Number'>1.5E3</span> <span class='Separator'>β‹„</span> <span class='Number'>∞</span> <span class='Bracket'>⟩</span> <span class='Comment'># A list of numbers
-</span>⟨ ¯3.14159265358979 0.5 0.5 1500 ∞ ⟩
+</span>⟨ ¯3.141592653589793 0.5 0.5 1500 ∞ ⟩
</pre>
<p>Strings are written with double quotes <code><span class='String'>&quot;&quot;</span></code>, and characters with single quotes <code><span class='String'>''</span></code> with a single character in between. A double quote within a string can be escaped by writing it twice; if two string literals are next to each other, they must be separated by a space. In contrast, character literals do not use escapes, as the length is already known.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omgwqgg4p+oICJzdHIiIOKLhCAicyd0IiJyIiDii4QgJ2MnIOKLhCAnJycg4ouEICciJyDin6kgICAjICIiIGlzIGFuIGVzY2FwZQoK4omhwqgg4p+oICJhIiDii4QgJ2EnIOKfqSAgICMgQSBzdHJpbmcgaXMgYW4gYXJyYXkgYnV0IGEgY2hhcmFjdGVyIGlzbid0">↗️</a><pre> <span class='Function'>β‰ </span><span class='Modifier'>Β¨</span> <span class='Bracket'>⟨</span> <span class='String'>&quot;str&quot;</span> <span class='Separator'>β‹„</span> <span class='String'>&quot;s't&quot;&quot;r&quot;</span> <span class='Separator'>β‹„</span> <span class='String'>'c'</span> <span class='Separator'>β‹„</span> <span class='String'>'''</span> <span class='Separator'>β‹„</span> <span class='String'>'&quot;'</span> <span class='Bracket'>⟩</span> <span class='Comment'># &quot;&quot; is an escape