From e2b07a5fd0bbaad232c717fb90a31d6c61d72bd4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 14 Jul 2022 20:06:50 -0400 Subject: Try to include previous variable definitions in REPL links --- docs/doc/leading.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/doc/leading.html') diff --git a/docs/doc/leading.html b/docs/doc/leading.html index b3b008c8..63cdc85f 100644 --- a/docs/doc/leading.html +++ b/docs/doc/leading.html @@ -34,7 +34,7 @@ ┘

To use these functions on another axis, use the Rank () or Cells (˘) modifier to find the one you want. For a rank 2 array like a, the most you'll ever need is a single ˘, because after the leading one there's only one other axis.

-↗️
    ˘ a                  # First column
+↗️
    ˘ a                  # First column
 "ace"
 
     ˘ a                  # Swap the columns
@@ -52,7 +52,7 @@
      ┘
 

In these three cases above, the results are the same as you would get from transposing before and after (which does nothing to the rank-1 result of ˘, but that's what's wanted). But in the following cases, the structure is quite different: a is a list of matrices while ˘a is a matrix of lists. This is because the functions , , and ` leave the trailing axis structure intact ( removes one axis); taking into account that Rank or Cells always preserves the leading or frame axes, all axes are preserved (except the one removed by ). But Prefixes or Suffixes move axes after the first from the whole of 𝕩 to elements of the result, pushing them down in depth, and Rank won't undo this sort of structural change.

-↗️
     a                   # Prefixes of a:    ranks 1|2
+↗️
     a                   # Prefixes of a:    ranks 1|2
 ┌─                           
 · ↕0‿2 ┌─     ┌─     ┌─      
        ╵"ab"  ╵"ab   ╵"ab    
@@ -79,7 +79,7 @@
      ┘
 

Solo (), something of a maverick, manages to act on zero leading axes of 𝕩 by creating the first axis of the result instead. Because it doesn't need any axis to work, it can go in front of either axis but also past the last one by working with rank 0, a case where most array functions would give an error.

-↗️
      a                 # Solo adds a length-1 axis
+↗️
      a                 # Solo adds a length-1 axis
 ⟨ 1 3 2 ⟩
 
     a    a             # First Cell undoes this
@@ -187,7 +187,7 @@
                   ┘
 

That's shape 324 matched with shape 3: the leading 3 agrees. Now to match with 32:

-↗️
     c  100 × 3 = 2  # A rank-2 array to add
+↗️
     c  100 × 3 = 2  # A rank-2 array to add
 ┌─         
 ╵ 100   0  
     0 100  
@@ -207,7 +207,7 @@
                   ┘
 

And of course, identical shapes agree:

-↗️
    x + x                 # Pairwise addition
+↗️
    x + x                 # Pairwise addition
 ┌─             
 ╎  0  2  4  6  
    8 10 12 14  
-- 
cgit v1.2.3