From 18d1bce85de22f8bc7a08453618c7d9e94b61f92 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 28 May 2022 21:55:15 -0400 Subject: Editing --- docs/doc/hook.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/doc/hook.html') diff --git a/docs/doc/hook.html b/docs/doc/hook.html index e300796a..a81c7b7d 100644 --- a/docs/doc/hook.html +++ b/docs/doc/hook.html @@ -102,7 +102,7 @@

Description

-

In the general case, I think of Before as using 𝔽 as a preprocessing function applied to 𝕨 (when there are two arguments) and After as using 𝔾 as preprocessing for 𝕩. Then the other operand is called on the result and remaining argument. Here are some simple calls with Pair (): the result is a pair that corresponds to 𝕨𝕩, but one or the other result has been modified by the pointy-side function.

+

In the general case, I think of Before as using 𝔽 as a preprocessing function applied to 𝕨 (when there are two arguments), and After as using 𝔾 as preprocessing for 𝕩. Then the other operand is called on the result and remaining argument. Here are some simple calls with Pair (): the result is a pair that corresponds to 𝕨𝕩, but one or the other result has been modified by the pointy-side function.

↗️
    9  2
 ⟨ 3 2 ⟩
 
@@ -117,7 +117,7 @@
 ↗️
    {𝕩<0}¨/ 4¯21¯3¯3
 ⟨ ¯2 ¯3 ¯3 ⟩
 
-

As < is a pervasive function, there's no need for the Each (¨) in this case, and the clunky block function {𝕩<0} can also be written smaller with a combinator, as <0. More on that in the next section…

+

As < is a pervasive function, there's no need for the Each (¨) in this case, and the clunky block function {𝕩<0} can also be written smaller with a combinator, as <0. More on that in the next section…

↗️
    <0/ 4¯21¯3¯3
 ⟨ ¯2 ¯3 ¯3 ⟩
 
@@ -126,7 +126,7 @@ ↗️
    <0  4¯21¯3¯3
 ⟨ 0 1 0 1 1 ⟩
 
-

If we expand <0 x, we get x < (0 x), which doesn't quite make sense. That's because 0 has a subject role, but always applies its operands as functions. It's more accurate to use x < (0{𝔽} x), or just skip ahead to x < 0.

+

If we expand <0 x, we get x < (0 x), which doesn't quite make sense. That's because 0 has a subject role, but always applies its operands as functions. It's more accurate to use x < (0{𝔽} x), or just skip ahead to x < 0.

Similar reasoning gives the following expansions:

@@ -150,7 +150,7 @@

Note that when there are two arguments, the constant "swallows" the one on the same side, so that the function is applied to the constant and the argument on the opposite side.

-

As in a train, if you want to use a function as a constant then you need to be explicity about it, with the Constant (˙) modifier.

+

As in a train, if you want to use a function as a constant then you need to be explicit about it, with the Constant (˙) modifier.

↗️
    3 (˙) 'a'+↕12
 ┌─      
 ╵"abcd  
@@ -161,7 +161,7 @@
 

In the more extreme case of wanting a modifier operand, you might try ({}˙), or (⊣⋈{}˙), or just cheat with .

Combinations

If you like to go tacit, you'll likely end up stringing together a few s and s at times. Of course the effects are entirely determined by the left-to-right precedence rule for modifiers, but it's interesting to examine what happens in more detail.

-

In the pattern FGH, the ordering doesn't matter at all! That is, it means (FG)H, but this is exactly the same function as F(GH). In both cases, F is applied to 𝕨, H is applied to 𝕩, and G acts on both the results.

+

In the pattern FGH, the ordering doesn't matter at all! That is, it means (FG)H, but this is the same function as F(GH). In both cases, F is applied to 𝕨, H is applied to 𝕩, and G acts on both the results (the parentheses do change whether F or H is called first, which only matters if they have side effects).

↗️
    4 - 2
 ⟨ ¯4 7.38905609893065 ⟩
 
@@ -187,4 +187,4 @@ (⌊≠÷2˙) "quicksort" # Use to partition 𝕩 ⟨ "ic" "quksort" ⟩
-

Three is rare, but I use two s all the time, as well as followed by , for example the <'a'/ filter on the front page. I think a combination like lotsofstuff/ x reads very nicely when moving from left to right. When I see / I know that I'm filtering x and can read the rest with that context. The reason that has all this power, but not , has nothing to do with the modifiers themselves, as they're completely symmetrical. It's all in the way BQN defines modifier grammar, left to right.

+

Three is rare, but I use two s all the time, as well as followed by , for example the <'a'/ filter on the front page. I think a combination like lotsofstuff/ x reads very nicely when moving from right to left. When I see / I know that I'm filtering x and can read the rest with that context. The reason has all this power, but not , has nothing to do with the modifiers themselves, as they're completely symmetrical. It's all in the way BQN defines modifier grammar, left to right.

-- cgit v1.2.3