From 2afb23928e1984d475cc460e1672e8f6fa0e4dbe Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 11 Aug 2021 17:21:31 -0400 Subject: Allow clicking on header to get fragment link --- docs/doc/take.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/take.html') diff --git a/docs/doc/take.html b/docs/doc/take.html index 0dcbaa39..1dd895ff 100644 --- a/docs/doc/take.html +++ b/docs/doc/take.html @@ -4,7 +4,7 @@ BQN: Take and Drop -

Take and Drop

+

Take and Drop

@@ -43,7 +43,7 @@

These extensions can be combined as well, so there are a lot of possibilities. A good picture to have in mind is cutting out a corner of the array 𝕩. This is because the result 𝕨↑𝕩 or 𝕨↓𝕩 always aligns with one side of 𝕩 along each axis, so it aligns with the corner where those sides meet.

The result d↓𝕩 is always the same as t↑𝕩 for some other argument t, but computing t wouldn't be too convenient. The reverse isn't true: only Take can insert fills, so results that include them can't come from Drop.

-

One axis

+

One axis

Let's start with a natural number 𝕨. Take gives the first 𝕨 major cells of 𝕩 (or elements of a list), while Drop gives all but the first 𝕨.

↗️
    4 ↑ "take and drop"
 "take"
@@ -76,7 +76,7 @@
     3 ↓ <"element"
 ⟨⟩
 
-

Negative argument

+

Negative argument

If 𝕨 is negative then wraps around the other side to take or drop from the end of 𝕩. It's a lot like negative indices in Select (⊏), but while negative indices are asymmetricβ€”0 is the first entry but Β―1 is the lastβ€”this case is symmetric. It's because the place to cut is always before the index 𝕨, cancelling out the negative index asymmetry.

↗️
    3 ↑ "abcdeEDCBA"
 "abc"
@@ -98,7 +98,7 @@
 ↗️
    Β―6 ↑ "xy"
 "    xy"
 
-

Multiple axes

+

Multiple axes

In the general case 𝕨 is a list of integers. They're matched with the leading axes of 𝕩, so that each affects one axis independently from the others.

↗️
    ⊒ m ← (10×↕5) +⌜ ↕7
 β”Œβ”€                      
-- 
cgit v1.2.3