aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/shape.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-16 18:23:52 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-16 18:24:01 -0400
commit2010e8b2897a5741e211980c9f8ec9177299c939 (patch)
tree4b3476744be928724da2fd5d83b0bf2e9a8ba502 /docs/doc/shape.html
parente3366f9e18a8791c43110e080b9ea45cfceefed8 (diff)
Finish links and editing documentation pass
Diffstat (limited to 'docs/doc/shape.html')
-rw-r--r--docs/doc/shape.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/doc/shape.html b/docs/doc/shape.html
index 5852a698..118353c6 100644
--- a/docs/doc/shape.html
+++ b/docs/doc/shape.html
@@ -8,7 +8,7 @@
<p>The function Shape (<code><span class='Function'>≢</span></code>) returns an array's shape, and Rank (<code><span class='Function'>=</span></code>) and Length (<code><span class='Function'>≠</span></code>) return properties that can be derived from the shape. BQN's arrays are multidimensional, so that the shape is a list of natural numbers (the length along each axis), while the rank (length of the shape) and length (of the first axis) are numbers. In these functions, an atom is treated as a unit array, which has rank 0 and empty shape. A unit has no first axis, but its length is defined to be 1.</p>
<p>Rank can be defined as <code><span class='Function'>≠</span><span class='Modifier2'>∘</span><span class='Function'>≢</span></code> while Length can be defined with a <a href="fold.html">fold</a> to be <code><span class='Number'>1</span><span class='Function'>⊣</span><span class='Modifier'>´</span><span class='Function'>≢</span></code>.</p>
<h2 id="examples">Examples</h2>
-<p>The function <a href="reshape.html">Reshape</a> (<code><span class='Function'>⥊</span></code>) always returns an array of shape <code><span class='Value'>𝕨</span></code>, so we use it to make an array of shape <code><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>6</span></code> in the example below (<a href="take.html">Take</a> (<code><span class='Function'>↑</span></code>) shares this property).</p>
+<p>The function <a href="reshape.html">Reshape</a> (<code><span class='Function'>⥊</span></code>) always returns an array of shape <code><span class='Value'>𝕨</span></code>, so we use it to make an array of shape <code><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>6</span></code> in the example below (<a href="take.html">Take</a> (<code><span class='Function'>↑</span></code>) shares this property if <code><span class='Paren'>(</span><span class='Function'>≠</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>≤=</span><span class='Value'>𝕩</span></code>).</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIGFyciDihpAgMeKAvzPigL8y4oC/NiDipYogJzAnK+KGlTEwCgriiaIgYXJyICAjIFNoYXBlCgriiaAgYXJyICAjIExlbmd0aAoKPSBhcnIgICMgUmFuaw==">↗️</a><pre> <span class='Function'>⊢</span> <span class='Value'>arr</span> <span class='Gets'>←</span> <span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>6</span> <span class='Function'>⥊</span> <span class='String'>'0'</span><span class='Function'>+↕</span><span class='Number'>10</span>
┌─
┆"012345
@@ -30,11 +30,11 @@
<span class='Function'>=</span> <span class='Value'>arr</span> <span class='Comment'># Rank
</span>4
</pre>
-<p>The length is the first element of the shape, and the rank is the length of the shape—the number of axes. For another example, taking the first (and only) cell of <code><span class='Value'>arr</span></code> gives an array with shape <code><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>6</span></code>, length <code><span class='Number'>3</span></code>, and rank <code><span class='Number'>3</span></code>, as we can see by applying each function to <code><span class='Function'>⊏</span><span class='Value'>arr</span></code>.</p>
+<p>The length is the first element of the shape, and the rank is the length of the shape—the number of axes. For another example, taking the first (and only) cell of <code><span class='Value'>arr</span></code> gives an array with shape <code><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>6</span></code>, length <code><span class='Number'>3</span></code>, and rank <code><span class='Number'>3</span></code>, as we can see by applying <a href="map.html#each">each</a> function to <code><span class='Function'>⊏</span><span class='Value'>arr</span></code>.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omi4oC/PeKAv+KJoCB78J2VjvCdlal9wqg8IOKKj2Fycg==">↗️</a><pre> <span class='Function'>≢</span><span class='Ligature'>‿</span><span class='Function'>=</span><span class='Ligature'>‿</span><span class='Function'>≠</span> <span class='Brace'>{</span><span class='Function'>𝕎</span><span class='Value'>𝕩</span><span class='Brace'>}</span><span class='Modifier'>¨</span><span class='Function'>&lt;</span> <span class='Function'>⊏</span><span class='Value'>arr</span>
⟨ ⟨ 3 2 6 ⟩ 3 3 ⟩
</pre>
-<p>Applying Shape and the other two functions to an atom shows a shape of <code><span class='Bracket'>⟨⟩</span></code>, the empty list, and a rank of zero and length of 1. The same is true of an enclosed array, which like an atom is a kind of unit.</p>
+<p>Applying Shape and the other two functions to an atom shows a shape of <code><span class='Bracket'>⟨⟩</span></code> (the empty list), and a rank of zero and length of 1. The same is true of an enclosed array, which like an atom is a kind of unit.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4omiIDUKCig9IOKJjSDiiaApIDUKCig9IOKJjSDiiaApIDzihpUxMA==">↗️</a><pre> <span class='Function'>≢</span> <span class='Number'>5</span>
⟨⟩