aboutsummaryrefslogtreecommitdiff
path: root/doc/join.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-02 22:30:39 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-06-02 22:30:39 -0400
commitbd8c5efa3a9aa79df09016bfd9c047023e7cf75d (patch)
treee5317178e80caa9457ec99e614821f2284a81d5f /doc/join.md
parentc3ea468236e362e4ecc1bc27aed7a64d90e7cf81 (diff)
Editing
Diffstat (limited to 'doc/join.md')
-rw-r--r--doc/join.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/join.md b/doc/join.md
index 656a12db..b687a946 100644
--- a/doc/join.md
+++ b/doc/join.md
@@ -10,7 +10,7 @@ Join To connects its two arguments together, for example to join two strings:
"abcd" ∾ "EFG"
-If the arguments have the same rank, then they are combined along the first axis: the result is an array whose major cells are the major cells of `𝕨` followed by the major cells of `𝕩`. For arrays with rank two or more, this means they will be joined "vertically" according to BQN's display.
+If the arguments have the same rank, then they are combined along the first axis: the result is an array whose [major cells](array.md#cells) are the major cells of `𝕨` followed by the major cells of `𝕩`. For arrays with rank two or more, this means they will be joined "vertically" according to BQN's [display](arrayrepr.md#array-display).
⊢ a ← 3 +⌜○↕ 4
⊢ b ← 2‿4 ⥊ ↕8
@@ -42,13 +42,15 @@ To join with a separator in between, we might prepend the separator to each stri
1↓∾' '∾¨"time"‿"to"‿"join"‿"some"‿"words"
+ ∾1↓⥊(<" * ")≍˘"time"‿"to"‿"join"‿"some"‿"words"
+
Join also extends the rank of a unit element (including an atom) to allow it to fit into the list. The highest-rank element determines the rank of the result.
∾"abc"‿'d'‿"ef"‿(<'g')
∾"abcd" # Result has to be rank 0, impossible
-However, Join has higher-dimensional uses as well. Given a rank-`m` array of rank-`n` arrays (requiring `m≤n`), it will merge arrays along their first `m` axes. For example, if the argument is a matrix of matrices representing a [block matrix](https://en.wikipedia.org/wiki/Block_matrix), Join will give the corresponding unblocked matrix as its result.
+Join has higher-dimensional uses as well. Given a rank-`m` array of rank-`n` arrays (requiring `m≤n`), it will merge arrays along their first `m` axes. For example, if the argument is a matrix of matrices representing a [block matrix](https://en.wikipedia.org/wiki/Block_matrix), Join will give the corresponding unblocked matrix as its result.
⊢ m ← (3‿1≍⌜4‿2‿5) ⥊¨ 2‿3⥊↕6
∾ m # Join all that together