aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/train.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-10-09 21:12:05 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-10-09 21:18:10 -0400
commitf2cd25f1ab2b04007c1f112dfffd3590e60f2d3b (patch)
tree94353b9dd5d9c174b1fe2be80a5d57479a134ccc /docs/doc/train.html
parent4ff015d2a879a61eb76ef3986fcce68e7b826850 (diff)
Documentation for Nothing
Diffstat (limited to 'docs/doc/train.html')
-rw-r--r--docs/doc/train.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/doc/train.html b/docs/doc/train.html
index 9675922c..d45742b0 100644
--- a/docs/doc/train.html
+++ b/docs/doc/train.html
@@ -6,7 +6,7 @@
<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">doc</a></div>
<h1 id="function-trains"><a class="header" href="#function-trains">Function trains</a></h1>
<p>Trains are an important aspect of BQN's <a href="tacit.html">tacit</a> programming capabilities. In fact, a crucial one: with trains and the <a href="identity.html">identity functions</a> Left (<code><span class='Function'>⊣</span></code>) and Right (<code><span class='Function'>⊢</span></code>), a fully tacit program can express any explicit function whose body is a statement with <code><span class='Value'>𝕨</span></code> and <code><span class='Value'>𝕩</span></code> used only as arguments (that is, there are no assignments and <code><span class='Value'>𝕨</span></code> and <code><span class='Value'>𝕩</span></code> are not used in operands or lists. Functions with assignments may have too many variables active at once to be directly translated but can be emulated by constructing lists. But it's probably a bad idea). Without trains it isn't possible to have two different functions that each use both arguments to a dyadic function. With trains it's perfectly natural.</p>
-<p>BQN's trains are the same as those of Dyalog APL, except that Dyalog is missing the minor convenience of BQN's Nothing (<code><span class='Nothing'>·</span></code>). There are many Dyalog-based documents and videos on trains you can view on the <a href="https://aplwiki.com/wiki/Train">APL Wiki</a>.</p>
+<p>BQN's trains are the same as those of Dyalog APL, except that Dyalog is missing the minor convenience of BQN's <a href="expression.html#nothing">Nothing</a> (<code><span class='Nothing'>·</span></code>). There are many Dyalog-based documents and videos on trains you can view on the <a href="https://aplwiki.com/wiki/Train">APL Wiki</a>.</p>
<h2 id="2-train-3-train"><a class="header" href="#2-train-3-train">2-train, 3-train</a></h2>
<p>Trains are an adaptation of the mathematical convention that, for example, two functions <code><span class='Function'>F</span></code> and <code><span class='Function'>G</span></code> can be added to get a new function <code><span class='Function'>F+G</span></code> that applies as <code><span class='Paren'>(</span><span class='Function'>F+G</span><span class='Paren'>)(</span><span class='Value'>x</span><span class='Paren'>)</span> <span class='Function'>=</span> <span class='Function'>F</span><span class='Paren'>(</span><span class='Value'>x</span><span class='Paren'>)</span><span class='Function'>+G</span><span class='Paren'>(</span><span class='Value'>x</span><span class='Paren'>)</span></code>. With a little change to the syntax, we can do exactly this in BQN:</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KOKKoivijL0pIOKGlTU=">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>⊢+⌽</span><span class='Paren'>)</span> <span class='Function'>↕</span><span class='Number'>5</span>