aboutsummaryrefslogtreecommitdiff
path: root/docs/help
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-28 20:56:46 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-28 21:02:27 -0500
commit9cfc45f731a121282f47218d6ab80c5b9b06e277 (patch)
treee5934a40c9c3e94651d767472369bfa7a38113f3 /docs/help
parent0c716e4c6b7c2c44bbfd02b6503cae66af7b7480 (diff)
Add ;:? to keybar and help
Diffstat (limited to 'docs/help')
-rw-r--r--docs/help/header.html25
-rw-r--r--docs/help/index.html12
-rw-r--r--docs/help/nextbody.html21
-rw-r--r--docs/help/predicate.html21
4 files changed, 79 insertions, 0 deletions
diff --git a/docs/help/header.html b/docs/help/header.html
new file mode 100644
index 00000000..2dccabef
--- /dev/null
+++ b/docs/help/header.html
@@ -0,0 +1,25 @@
+<head>
+ <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
+ <link href="../style.css" rel="stylesheet"/>
+ <title>BQN Colon (:)</title>
+</head>
+<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">help</a></div>
+<h1 id="colon-"><a class="header" href="#colon-">Colon (<code><span class='Head'>:</span></code>)</a></h1>
+<h2 id="-header"><a class="header" href="#-header"><code><span class='Head'>:</span></code>: Header</a></h2>
+<p><a class="fulldoc" href="../doc/block.html#block-headers">→full documentation</a></p>
+<p>Placed at the end of a block header. A header has syntax that matches the way the block is called. It indicates the block type, and number and structure of inputs.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=Inh5IiB7YeKAv2IgX29wIGM6IGJ9IOKIng==">↗️</a><pre> <span class='String'>&quot;xy&quot;</span> <span class='Brace'>{</span><span class='Value'>a</span><span class='Ligature'>‿</span><span class='Value'>b</span> <span class='Modifier'>_op</span> <span class='Value'>c</span><span class='Head'>:</span> <span class='Value'>b</span><span class='Brace'>}</span> <span class='Number'>∞</span>
+'y'
+</pre>
+<p>Multiple bodies are searched in order to find one with a matching header.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=RiDihpAge20gRm4gbjogbStGbiBuOyAg8J2Vim46IDLDl247ICDwnZWK4oG88J2VqTog8J2VqcO3Mn0KCkYgMyAgICAgICMg8J2Vim4KCkbigbwgNiAgICAgIyDwnZWK4oG88J2VqQoKMTAgRiAzICAgIyBtIEZuIG4=">↗️</a><pre> <span class='Function'>F</span> <span class='Gets'>←</span> <span class='Brace'>{</span><span class='Value'>m</span> <span class='Function'>Fn</span> <span class='Value'>n</span><span class='Head'>:</span> <span class='Value'>m</span><span class='Function'>+Fn</span> <span class='Value'>n</span><span class='Head'>;</span> <span class='Function'>𝕊</span><span class='Value'>n</span><span class='Head'>:</span> <span class='Number'>2</span><span class='Function'>×</span><span class='Value'>n</span><span class='Head'>;</span> <span class='Function'>𝕊</span><span class='Modifier'>⁼</span><span class='Value'>𝕩</span><span class='Head'>:</span> <span class='Value'>𝕩</span><span class='Function'>÷</span><span class='Number'>2</span><span class='Brace'>}</span>
+
+ <span class='Function'>F</span> <span class='Number'>3</span> <span class='Comment'># 𝕊n
+</span>6
+
+ <span class='Function'>F</span><span class='Modifier'>⁼</span> <span class='Number'>6</span> <span class='Comment'># 𝕊⁼𝕩
+</span>3
+
+ <span class='Number'>10</span> <span class='Function'>F</span> <span class='Number'>3</span> <span class='Comment'># m Fn n
+</span>16
+</pre>
diff --git a/docs/help/index.html b/docs/help/index.html
index 77f2dfa4..50372097 100644
--- a/docs/help/index.html
+++ b/docs/help/index.html
@@ -179,6 +179,10 @@
<td><a href="groupindices_group.html">Group Indices, Group</a></td>
</tr>
<tr>
+<td><code><span class='Head'>:</span></code></td>
+<td><a href="header.html">Header</a></td>
+</tr>
+<tr>
<td><code><span class='Function'>⊣</span></code></td>
<td><a href="identity_left.html">Identity, Left</a></td>
</tr>
@@ -239,6 +243,10 @@
<td><a href="negate_subtract.html">Negate, Subtract</a></td>
</tr>
<tr>
+<td><code><span class='Head'>;</span></code></td>
+<td><a href="nextbody.html">Next Body</a></td>
+</tr>
+<tr>
<td><code><span class='Nothing'>·</span></code></td>
<td><a href="nothing.html">Nothing</a></td>
</tr>
@@ -263,6 +271,10 @@
<td><a href="pi.html">Pi</a></td>
</tr>
<tr>
+<td><code><span class='Head'>?</span></code></td>
+<td><a href="predicate.html">Predicate</a></td>
+</tr>
+<tr>
<td><code><span class='Function'>↑</span></code></td>
<td><a href="prefixes_take.html">Prefixes, Take</a></td>
</tr>
diff --git a/docs/help/nextbody.html b/docs/help/nextbody.html
new file mode 100644
index 00000000..f180ec55
--- /dev/null
+++ b/docs/help/nextbody.html
@@ -0,0 +1,21 @@
+<head>
+ <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
+ <link href="../style.css" rel="stylesheet"/>
+ <title>BQN: Semicolon (;)</title>
+</head>
+<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">help</a></div>
+<h1 id="semicolon-"><a class="header" href="#semicolon-">Semicolon (<code><span class='Head'>;</span></code>)</a></h1>
+<h2 id="-next-body"><a class="header" href="#-next-body"><code><span class='Head'>;</span></code>: Next Body</a></h2>
+<p><a class="fulldoc" href="../doc/block.html#multiple-bodies">→full documentation</a></p>
+<p>End the current block body and start a new one. <a href="header.html">Headers</a> (<code><span class='Head'>:</span></code>) and <a href="predicate.html">predicates</a> (<code><span class='Head'>?</span></code>) can control which body is evaluated. A function can have two headers without these, indicating the monadic and dyadic cases.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MyB7IPCdlanDtzIgOyAt8J2VqOKAv/CdlakgfSA0ICAgIyBNb25hZGljIGFuZCBkeWFkaWMgY2FzZXMKCkYg4oaQIHvwnZWKYeKAv2I6IGEtYjsg8J2VimHigL9i4oC/YzogYitjfQoKRiA14oC/MiAgICAgICAgICAgICAgICAjIE1hdGNoZXMgZmlyc3QgaGVhZGVyCgpGIDHigL8z4oC/NiAgICAgICAgICAgICAgIyBNYXRjaGVzIHNlY29uZCBoZWFkZXI=">↗️</a><pre> <span class='Number'>3</span> <span class='Brace'>{</span> <span class='Value'>𝕩</span><span class='Function'>÷</span><span class='Number'>2</span> <span class='Head'>;</span> <span class='Function'>-</span><span class='Value'>𝕨</span><span class='Ligature'>‿</span><span class='Value'>𝕩</span> <span class='Brace'>}</span> <span class='Number'>4</span> <span class='Comment'># Monadic and dyadic cases
+</span>⟨ ¯3 ¯4 ⟩
+
+ <span class='Function'>F</span> <span class='Gets'>←</span> <span class='Brace'>{</span><span class='Function'>𝕊</span><span class='Value'>a</span><span class='Ligature'>‿</span><span class='Value'>b</span><span class='Head'>:</span> <span class='Value'>a</span><span class='Function'>-</span><span class='Value'>b</span><span class='Head'>;</span> <span class='Function'>𝕊</span><span class='Value'>a</span><span class='Ligature'>‿</span><span class='Value'>b</span><span class='Ligature'>‿</span><span class='Value'>c</span><span class='Head'>:</span> <span class='Value'>b</span><span class='Function'>+</span><span class='Value'>c</span><span class='Brace'>}</span>
+
+ <span class='Function'>F</span> <span class='Number'>5</span><span class='Ligature'>‿</span><span class='Number'>2</span> <span class='Comment'># Matches first header
+</span>3
+
+ <span class='Function'>F</span> <span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>6</span> <span class='Comment'># Matches second header
+</span>9
+</pre>
diff --git a/docs/help/predicate.html b/docs/help/predicate.html
new file mode 100644
index 00000000..fdd89394
--- /dev/null
+++ b/docs/help/predicate.html
@@ -0,0 +1,21 @@
+<head>
+ <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
+ <link href="../style.css" rel="stylesheet"/>
+ <title>BQN: Question Mark (?)</title>
+</head>
+<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">help</a></div>
+<h1 id="question-mark-"><a class="header" href="#question-mark-">Question Mark (<code><span class='Head'>?</span></code>)</a></h1>
+<h2 id="-predicate"><a class="header" href="#-predicate"><code><span class='Head'>?</span></code>: Predicate</a></h2>
+<p><a class="fulldoc" href="../doc/block.html#predicates">→full documentation</a></p>
+<p>Follows a statement in a block, which must return 0 or 1. If it's 0, stop the current body and evaluate the next eligible one instead. Variables defined before the <code><span class='Head'>?</span></code> stay if execution continues (1) but don't carry over to other bodies (0).</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=ezAgPyAzIDsgNH0KCk1pbiDihpAge/Cdlag88J2VqSA/IPCdlaggOyDwnZWpfQoKMyBNaW4gNQoKNCBNaW4gMg==">↗️</a><pre> <span class='Brace'>{</span><span class='Number'>0</span> <span class='Head'>?</span> <span class='Number'>3</span> <span class='Head'>;</span> <span class='Number'>4</span><span class='Brace'>}</span>
+4
+
+ <span class='Function'>Min</span> <span class='Gets'>←</span> <span class='Brace'>{</span><span class='Value'>𝕨</span><span class='Function'>&lt;</span><span class='Value'>𝕩</span> <span class='Head'>?</span> <span class='Value'>𝕨</span> <span class='Head'>;</span> <span class='Value'>𝕩</span><span class='Brace'>}</span>
+
+ <span class='Number'>3</span> <span class='Function'>Min</span> <span class='Number'>5</span>
+3
+
+ <span class='Number'>4</span> <span class='Function'>Min</span> <span class='Number'>2</span>
+2
+</pre>