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/reverse.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/reverse.html') diff --git a/docs/doc/reverse.html b/docs/doc/reverse.html index 104a7e44..d1a9ccec 100644 --- a/docs/doc/reverse.html +++ b/docs/doc/reverse.html @@ -4,10 +4,10 @@ BQN: Reverse and Rotate -

Reverse and Rotate

+

Reverse and Rotate

The symbol indicates two different array transformations: with no left argument, it reverses the major cells of the array, but with a left argument, it rotates or cycles them around. These two possibilities, first put together in very early versions of APL, can't be considered restrictions or different views of some unifying function, but there are connections between them. Each returns an array with the same shape and all the same elements as 𝕩, possibly in a different arrangement. And elements that start out next to each other in 𝕩 generally stay next to each other—always, if we consider an element on one edge to be next to the one opposite to it. One might think of them as isometries preserving a discrete subgroup of the torus, if one were inclined to think such things. On major cells, the two functions decompose the dihedral group okay I'll stop.

Many uses of Rotate in APL are better handled by shift functions in BQN. If there's no reason to treat the data as cyclic or periodic, it's best to avoid Rotate.

-

Reverse

+

Reverse

There's not too much to say about Reverse. It puts the elements of a list the other way around, or more generally the major cells of an array.

↗️
     "abcdefg"
 "gfedcba"
@@ -45,7 +45,7 @@
     ` 0010010
 ⟨ 1 1 1 1 1 1 0 ⟩
 
-

Rotate

+

Rotate

Rotate moves elements in a list around cyclically. It can also rotate any number of axes of the argument array by different amounts at once. That's discussed in the next section; for now we'll stick to a single number for 𝕨. It has to be an integer, and 𝕩 has to be an array with at least one axis.

↗️
    2  "rotate"
 "tatero"
@@ -73,7 +73,7 @@
 ↗️
    ¯2  "rotate"
 "terota"
 
-

Multiple axes

+

Multiple axes

The easiest way to rotate a later array axis is usually to use the Cells (˘) or Rank () modifier.

↗️
     tab  34"abcdABCD0123"
 ┌─      
-- 
cgit v1.2.3