diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-02-18 10:57:09 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-02-18 10:57:09 -0500 |
| commit | 2619a61040d559954622dde830916ce6fd3df250 (patch) | |
| tree | 1c3c2b78daccae005b03f4b08676108bdfcd6167 /docs/doc | |
| parent | cca369861f01cb809ee80ae765549c0eb4114eb3 (diff) | |
Regenerate doc
Diffstat (limited to 'docs/doc')
| -rw-r--r-- | docs/doc/tacit.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/doc/tacit.html b/docs/doc/tacit.html index b65bac49..51d0d82d 100644 --- a/docs/doc/tacit.html +++ b/docs/doc/tacit.html @@ -17,7 +17,7 @@ ⟨ 5 1 ⟩ </pre> <p>The first of these expressions is the most direct, but with the variable name buried inside, it can't be used on an intermediate value and its input will have to be named. The other two forms stand alone as functions, so they can easily be placed anywhere in a program, even as an operand. But with even the small amount of structure added by a BQN anonymous function, the second method has more organization than action! The third, tacit, version strips away most of the organizing syntax to leave us with the essential pieces <code><span class='Number'>0</span></code>, <code><span class='Function'><</span></code>, and <code><span class='Function'>/</span></code> joined by combinators. The explicit function uses <code><span class='Value'>𝕩</span></code> as a sort of pronoun ("I want the elements of it where it's greater than zero"), while the tacit one elides it ("give me the elements greater than zero").</p> -<p>The ability to easily combine tacit and "explicit" programming such as statements or anonymous functions, far from being only a way to mitigate the disadvantages of these two methods, brings new advantages that no single paradigm could accomplish. Purely tacit programming <em>requires</em> programs to use <em>no</em> local variable names, but partly tacit programming <em>allows</em> them to use <em>fewer</em> names. That means names can be used only for the parts of a program that represent clean, human-understandable concepts. Another possible stategic choice is to use the fact that variables in a tacit expression are expanded as it's formed but those inside a block aren't. So <code><span class='Function'>F</span><span class='Gets'>←</span><span class='Value'>a</span><span class='Modifier2'>⊸</span><span class='Function'>+</span></code> can be chosen to "freeze" the value of <code><span class='Value'>a</span></code> in <code><span class='Function'>F</span></code> without having to use an extra variable, while <code><span class='Function'>F</span><span class='Gets'>←</span><span class='Brace'>{</span><span class='Value'>a</span><span class='Function'>+</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code> uses the current value of <code><span class='Value'>a</span></code> each time <code><span class='Function'>F</span></code> is called.</p> +<p>The ability to easily combine tacit and "explicit" programming such as statements or anonymous functions, far from being only a way to mitigate the disadvantages of these two methods, brings new advantages that no single paradigm could accomplish. Purely tacit programming <em>requires</em> programs to use <em>no</em> local variable names, but partly tacit programming <em>allows</em> them to use <em>fewer</em> names. That means names can be used only for the parts of a program that represent clean, human-understandable concepts. Another possible strategic choice is to use the fact that variables in a tacit expression are expanded as it's formed but those inside a block aren't. So <code><span class='Function'>F</span><span class='Gets'>←</span><span class='Value'>a</span><span class='Modifier2'>⊸</span><span class='Function'>+</span></code> can be chosen to "freeze" the value of <code><span class='Value'>a</span></code> in <code><span class='Function'>F</span></code> without having to use an extra variable, while <code><span class='Function'>F</span><span class='Gets'>←</span><span class='Brace'>{</span><span class='Value'>a</span><span class='Function'>+</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code> uses the current value of <code><span class='Value'>a</span></code> each time <code><span class='Function'>F</span></code> is called.</p> <p>The rest of this page describes BQN's tacit programming facilities. Deciding when to use them is a matter of taste, and experience.</p> <h2 id="trains"><a class="header" href="#trains">Trains</a></h2> <p>In modern APL and its relatives, the backbone of tacit infrastructure is the <em>function train</em>. Trains can take some practice to understand and use well, so they're described in more depth on <a href="train.html">a dedicated page</a>. The idea of trains is that you can "apply" a function to other functions, forming a composed function where it will actually apply to their results. So a typical use is to pair two functions as shown below: the pair <code><span class='Function'>»</span><span class='Ligature'>‿</span><span class='Function'>«</span></code> is never formed, but the result of applying <code><span class='Function'>T</span></code> is a pair.</p> |
