From 2619a61040d559954622dde830916ce6fd3df250 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 18 Feb 2022 10:57:09 -0500 Subject: Regenerate doc --- docs/doc/tacit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') 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 ⟩

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 0, <, and / joined by combinators. The explicit function uses 𝕩 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").

-

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 requires programs to use no local variable names, but partly tacit programming allows them to use fewer 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 Fa+ can be chosen to "freeze" the value of a in F without having to use an extra variable, while F{a+𝕩} uses the current value of a each time F is called.

+

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 requires programs to use no local variable names, but partly tacit programming allows them to use fewer 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 Fa+ can be chosen to "freeze" the value of a in F without having to use an extra variable, while F{a+𝕩} uses the current value of a each time F is called.

The rest of this page describes BQN's tacit programming facilities. Deciding when to use them is a matter of taste, and experience.

Trains

In modern APL and its relatives, the backbone of tacit infrastructure is the function train. Trains can take some practice to understand and use well, so they're described in more depth on a dedicated page. 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 »« is never formed, but the result of applying T is a pair.

-- cgit v1.2.3