diff options
Diffstat (limited to 'docs/doc/join.html')
| -rw-r--r-- | docs/doc/join.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/doc/join.html b/docs/doc/join.html index d9cac584..c3de72ae 100644 --- a/docs/doc/join.html +++ b/docs/doc/join.html @@ -5,7 +5,7 @@ </head> <div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="join-and-join-to">Join and Join To</h1> -<p>The glyph <code><span class='Function'>∾</span></code> combines arrays along an existing axis, a concept that other languages might call "concatenation" or "catenation" but BQN names "Join". The one-argument form Join and two-argument form Join To are parallel to the <a href="couple.html">functions that combine arrays along a new axis</a>, Merge (<code><span class='Function'>></span></code>) and Couple (<code><span class='Function'>≍</span></code>).</p> +<p>The glyph <code><span class='Function'>∾</span></code> combines arrays along an existing axis, a concept that other languages might call "concatenation" or "catenation" but BQN names "Join". The one-argument form Join and two-argument form Join To are parallel to <a href="couple.html">the functions</a> that combine arrays along a new axis, Merge (<code><span class='Function'>></span></code>) and Couple (<code><span class='Function'>≍</span></code>).</p> <h2 id="join-to">Join To</h2> <p>Join To connects its two arguments together, for example to join two strings:</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=ImFiY2QiIOKIviAiRUZHIg==">↗️</a><pre> <span class='String'>"abcd"</span> <span class='Function'>∾</span> <span class='String'>"EFG"</span> @@ -33,8 +33,8 @@ ┘ </pre> <p>For this definition to work, major cells of <code><span class='Value'>𝕨</span></code> and <code><span class='Value'>𝕩</span></code> have to have the same shape. That means that <code><span class='Value'>𝕨</span><span class='Function'>≡</span><span class='Modifier2'>○</span><span class='Paren'>(</span><span class='Number'>1</span><span class='Function'>↓≢</span><span class='Paren'>)</span><span class='Value'>𝕩</span></code>, and the shape of the result is the sum of the lengths of <code><span class='Value'>𝕨</span></code> and <code><span class='Value'>𝕩</span></code> followed by their shared major cell shape: to use a self-referential definition, the final shape is given by <code><span class='Function'>+</span><span class='Modifier2'>○</span><span class='Function'>≠</span> <span class='Function'>∾</span> <span class='Function'>⊣</span><span class='Modifier'>⁼</span><span class='Modifier2'>○</span><span class='Paren'>(</span><span class='Number'>1</span><span class='Function'>↓≢</span><span class='Paren'>)</span></code> for arguments of equal rank.</p> -<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=YSDiiL4gMuKAvzXipYpi">↗️</a><pre> <span class='Value'>a</span> <span class='Function'>∾</span> <span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>5</span><span class='Function'>⥊</span><span class='Value'>b</span> -ERROR +<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=YSDiiL4gMuKAvzXipYpiICAjIFNoYXBlcyBkb24ndCBmaXQ=">↗️</a><pre> <span class='Value'>a</span> <span class='Function'>∾</span> <span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>5</span><span class='Function'>⥊</span><span class='Value'>b</span> <span class='Comment'># Shapes don't fit +</span>ERROR </pre> <p>Join To will also allow arguments with ranks that are one apart. In this case, the smaller-rank argument is treated as a major cell in its entirety. If for example <code><span class='Value'>𝕨</span><span class='Function'><</span><span class='Modifier2'>○</span><span class='Function'>=</span><span class='Value'>𝕩</span></code>, then we must have <code><span class='Paren'>(</span><span class='Function'>≢</span><span class='Value'>𝕨</span><span class='Paren'>)</span><span class='Function'>≡</span><span class='Number'>1</span><span class='Function'>↓≢</span><span class='Value'>𝕩</span></code>, and the result shape is <code><span class='Number'>1</span><span class='Modifier2'>⊸</span><span class='Function'>+</span><span class='Modifier2'>⌾</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=NOKAvzLigL8z4oC/MCDiiL4gYQ==">↗️</a><pre> <span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>0</span> <span class='Function'>∾</span> <span class='Value'>a</span> |
