aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-06-30 22:44:44 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-06-30 22:45:15 -0400
commit15281037815c136b70d1410e4000e570d6ec019a (patch)
tree33efa06bd41f63f7843050353e0ce6626112c822
parent775ac2d9832065f15f3d4d953a8ab6c99b222558 (diff)
Select documentation, single-axis case only
-rw-r--r--doc/README.md1
-rw-r--r--doc/primitive.md2
-rw-r--r--doc/select.md99
-rw-r--r--docs/doc/index.html1
-rw-r--r--docs/doc/primitive.html4
-rw-r--r--docs/doc/select.html163
6 files changed, 267 insertions, 3 deletions
diff --git a/doc/README.md b/doc/README.md
index 5b04d279..c3e830b6 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -48,6 +48,7 @@ Primitives:
- [Repeat](repeat.md) (`⍟`)
- [Reverse and Rotate](reverse.md) (`⌽`)
- [Scan](scan.md) (`` ` ``)
+- [Select](select.md) (`⊏`)
- [Self-comparison functions](selfcmp.md) (`⊐⊒∊⍷`)
- [Shift functions](shift.md) (`»«`)
- [Solo, Couple, and Merge](couple.md) (`≍>`)
diff --git a/doc/primitive.md b/doc/primitive.md
index 481ab2b3..4450121d 100644
--- a/doc/primitive.md
+++ b/doc/primitive.md
@@ -49,7 +49,7 @@ Functions that have significant differences from APL functions are marked with a
| `/` | [Indices](replicate.md#indices) | [Replicate](replicate.md)
| `⍋` | [Grade Up](order.md#grade) | [Bins Up](order.md#bins)
| `⍒` | [Grade Down](order.md#grade) | [Bins Down](order.md#bins)
-| `⊏` | First Cell* | Select*
+| `⊏` | [First Cell](select.md)* | [Select](select.md)*
| `⊑` | [First](https://aplwiki.com/wiki/First) | Pick*
| `⊐` | [Classify](selfcmp.md#classify)* (`⍷⊸⊐`) | [Index of](https://aplwiki.com/wiki/Index_Of)
| `⊒` | [Occurrence Count](selfcmp.md#occurrence-count)* | Progressive Index of*
diff --git a/doc/select.md b/doc/select.md
new file mode 100644
index 00000000..69f6595e
--- /dev/null
+++ b/doc/select.md
@@ -0,0 +1,99 @@
+*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/doc/select.html).*
+
+# Select
+
+<!--GEN
+d ← 48‿58
+
+rc ← At "class=code|stroke-width=1.5|rx=12"
+Ge ← "g"⊸At⊸Enc
+g ← "font-family=BQN,monospace|font-size=22px|text-anchor=middle"
+cg ← "font-size=18px|text-anchor=end"
+lg ← "class=lilac|stroke-width=2|stroke-linecap=round"
+ig ← "fill=currentColor|font-size=12|opacity=0.75"
+
+xt ← '''(Highlight∾∾⊣)¨"select"
+wt ← Highlight∘•Repr¨ wv ← 2‿1‿1‿5
+
+Text ← ("text" Attr "dy"‿"0.32em"∾(Pos d⊸×))⊸Enc
+Line ← "line" Elt ("xy"≍⌜"12")≍˘○⥊ ·FmtNum d⊸×
+Rp ← Pos⊸∾⟜("width"‿"height"≍˘FmtNum)○(d⊸×)
+
+tx‿tw ← ↕∘≠¨ xt‿wt ⋄ y ← 0.6+↕3
+dim ← ⟨1.8+≠xt, ≠y⟩ ⋄ sh ← ¯2‿0
+tp ← (1‿2/tx‿tw) ≍¨¨ y
+
+((∾˜d)×((-∾+˜)1.1‿0.3)+sh∾dim) SVG g Ge ⟨
+ "rect" Elt rc ∾ sh Rp dim
+ lg Ge Line¨ (≍˘⟜-0.2≍˜0.08×·÷´-˝˘)⊸+¨ ∾(⟨wv⊏tx,tw⟩≍¨¨<tw)≍¨⟜<¨<˘2↕y
+ (∾tp) Text¨ ∾⟨xt,wt,wv⊏xt⟩
+ ig Ge (-⟜0‿0.33¨⊑tp) Text¨ •Repr¨ ↕≠xt
+ cg Ge (¯0.8≍¨y) Text⟜Highlight¨ "𝕩"‿"𝕨 "‿"𝕨⊏𝕩"
+⟩
+-->
+
+The function Select (`⊏`) reorganizes the array `𝕩` along one or more axes based on [indices](indices.md) given by `𝕨`. The result has the same [depth](depth.md) as `𝕩`, since its elements are always elements of `𝕩`. This means it differs from Pick (`⊑`), which takes elements from `𝕩` but can arrange them in any nested structure, including returning an element directly.
+
+The monadic form First Cell (`⊏`) gets the major cell with index 0, so that `⊏𝕩` is identical to `0⊏𝕩`.
+
+## Single selection
+
+Each axis of a BQN array is numbered starting at zero. Major cells are arranged along the first axis; in accordance with the [leading axis](leading.md) principle, Select returns a major cell of `𝕩` when `𝕨` is an atom.
+
+ 2 ⊏ "abcdef" # An enclosed element
+
+ 2 ⊑ "abcdef" # Pick gets a non-enclosed element
+
+ 2 ⊏ >"nul"‿"one"‿"two"‿"tre"‿"for"
+
+ 0 ⊏ <5 # No first axis to select from
+
+As a major cell of `𝕩`, the result has rank one less than it and its shape is `1↓≢𝕩`. `𝕩` must have rank one or more.
+
+The index `𝕨` has to be an integer less than `≠𝕩`. It can be negative, in which case it must be greater than or equal to `-≠𝕩`. Negative indices select from the end of `𝕩`, in that `¯1` indicates the last major cell and `-≠𝕩` indicates the first. If `≠𝕩` is 0, then no index is valid.
+
+ ¯2 ⊏ "abcdef"
+
+ 0 ⊏ ""
+
+The monadic case First Cell (`⊏𝕩`) is identical to `0⊏𝕩`. It has the same restrictions: `𝕩` must have rank 1 or more, and length 1 or more (this differs from First (`⊑`), which removes the length requirement to return a fill element).
+
+ ⊏ "abc"
+
+ ⊏ "abc"≍"def"
+
+ ⊏ ≍ "abc"
+
+ ⊏ 'a'
+
+## First-axis selection
+
+If `𝕨` is an array of numbers (including any empty array), then each number indicates a major cell of `𝕩`. In the simplest case, a list of numbers gives a result with the same rank as `𝕩` but maybe not the same length.
+
+ 2‿3‿3‿0‿4‿1 ⊏ "OlZEt"
+
+ ⟨⟩ ⊏ "OlZEt"
+
+To find the first and last cells of `𝕩`, use `0‿¯1` for the left argument.
+
+ ⊢ m ← 3‿5‿7‿11 |⌜ ט↕7
+
+ 0‿¯1 ⊏ m
+
+More generally, `𝕨` can be an array of any rank. Each of its 0-cells—containing a single number—is replaced with a cell of `𝕩` in the result. The result's shape is then made up of the shape of `𝕨` and the major cell shape of `𝕩`: it's `(≢𝕨)∾1↓≢𝕩`. When `𝕩` is a list, the result has the same shape as `𝕨`. Elements of `𝕨` are replaced one-for-one with elements of `𝕩`.
+
+ 2|m
+
+ (2|m) ⊏ " *"
+
+Another special case is when `𝕨` is a unit. Now the result shape will be the major cell shape of `𝕩`. In fact it's the same as the atom case above, that is, for a number `n`, `(<n)⊏𝕩` is the same as `n⊏𝕩`.
+
+The general case can result in a complicated array. Remember that the initial axes come from `𝕨` while later ones come from `𝕩`.
+
+ "awA0" +⌜ ↕4
+
+ 2 ↕ ↕4
+
+ (2 ↕ ↕4) ⊏ "awA0" +⌜ ↕4
+
+## Multi-axis selection
diff --git a/docs/doc/index.html b/docs/doc/index.html
index 484a7227..16511895 100644
--- a/docs/doc/index.html
+++ b/docs/doc/index.html
@@ -54,6 +54,7 @@
<li><a href="repeat.html">Repeat</a> (<code><span class='Modifier2'>⍟</span></code>)</li>
<li><a href="reverse.html">Reverse and Rotate</a> (<code><span class='Function'>⌽</span></code>)</li>
<li><a href="scan.html">Scan</a> (<code><span class='Modifier'>`</span></code>)</li>
+<li><a href="select.html">Select</a> (<code><span class='Function'>⊏</span></code>)</li>
<li><a href="selfcmp.html">Self-comparison functions</a> (<code><span class='Function'>⊐⊒∊⍷</span></code>)</li>
<li><a href="shift.html">Shift functions</a> (<code><span class='Function'>»«</span></code>)</li>
<li><a href="couple.html">Solo, Couple, and Merge</a> (<code><span class='Function'>≍&gt;</span></code>)</li>
diff --git a/docs/doc/primitive.html b/docs/doc/primitive.html
index 9eddb08d..638595d9 100644
--- a/docs/doc/primitive.html
+++ b/docs/doc/primitive.html
@@ -196,8 +196,8 @@
</tr>
<tr>
<td><code><span class='Function'>⊏</span></code></td>
-<td>First Cell*</td>
-<td>Select*</td>
+<td><a href="select.html">First Cell</a>*</td>
+<td><a href="select.html">Select</a>*</td>
</tr>
<tr>
<td><code><span class='Function'>⊑</span></code></td>
diff --git a/docs/doc/select.html b/docs/doc/select.html
new file mode 100644
index 00000000..13589621
--- /dev/null
+++ b/docs/doc/select.html
@@ -0,0 +1,163 @@
+<head>
+ <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
+ <link href="../style.css" rel="stylesheet"/>
+ <title>BQN: Select</title>
+</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="select">Select</h1>
+<svg viewBox='-148.8 -17.4 480 208.8'>
+ <g font-family='BQN,monospace' font-size='22px' text-anchor='middle'>
+ <rect class='code' stroke-width='1.5' rx='12' x='-96' y='0' width='374.4' height='174'/>
+ <g class='lilac' stroke-width='2' stroke-linecap='round'>
+ <line x1='88.32' x2='7.68' y1='46.4' y2='81.2'/>
+ <line x1='48' x2='48' y1='46.4' y2='81.2'/>
+ <line x1='51.84' x2='92.16' y1='46.4' y2='81.2'/>
+ <line x1='232.32' x2='151.68' y1='46.4' y2='81.2'/>
+ <line x1='0' x2='0' y1='104.4' y2='139.2'/>
+ <line x1='48' x2='48' y1='104.4' y2='139.2'/>
+ <line x1='96' x2='96' y1='104.4' y2='139.2'/>
+ <line x1='144' x2='144' y1='104.4' y2='139.2'/>
+ </g>
+ <text dy='0.32em' x='0' y='34.8'><tspan class='String'>'s'</tspan></text>
+ <text dy='0.32em' x='48' y='34.8'><tspan class='String'>'e'</tspan></text>
+ <text dy='0.32em' x='96' y='34.8'><tspan class='String'>'l'</tspan></text>
+ <text dy='0.32em' x='144' y='34.8'><tspan class='String'>'e'</tspan></text>
+ <text dy='0.32em' x='192' y='34.8'><tspan class='String'>'c'</tspan></text>
+ <text dy='0.32em' x='240' y='34.8'><tspan class='String'>'t'</tspan></text>
+ <text dy='0.32em' x='0' y='92.8'><tspan class='Number'>2</tspan></text>
+ <text dy='0.32em' x='48' y='92.8'><tspan class='Number'>1</tspan></text>
+ <text dy='0.32em' x='96' y='92.8'><tspan class='Number'>1</tspan></text>
+ <text dy='0.32em' x='144' y='92.8'><tspan class='Number'>5</tspan></text>
+ <text dy='0.32em' x='0' y='150.8'><tspan class='String'>'l'</tspan></text>
+ <text dy='0.32em' x='48' y='150.8'><tspan class='String'>'e'</tspan></text>
+ <text dy='0.32em' x='96' y='150.8'><tspan class='String'>'e'</tspan></text>
+ <text dy='0.32em' x='144' y='150.8'><tspan class='String'>'t'</tspan></text>
+ <g fill='currentColor' font-size='12' opacity='0.75'>
+ <text dy='0.32em' x='0' y='15.66'>0</text>
+ <text dy='0.32em' x='48' y='15.66'>1</text>
+ <text dy='0.32em' x='96' y='15.66'>2</text>
+ <text dy='0.32em' x='144' y='15.66'>3</text>
+ <text dy='0.32em' x='192' y='15.66'>4</text>
+ <text dy='0.32em' x='240' y='15.66'>5</text>
+ </g>
+ <g font-size='18px' text-anchor='end'>
+ <text dy='0.32em' x='-38.4' y='34.8'><tspan class='Value'>𝕩</tspan></text>
+ <text dy='0.32em' x='-38.4' y='92.8'><tspan class='Value'>𝕨</tspan> </text>
+ <text dy='0.32em' x='-38.4' y='150.8'><tspan class='Value'>𝕨</tspan><tspan class='Function'>⊏</tspan><tspan class='Value'>𝕩</tspan></text>
+ </g>
+ </g>
+</svg>
+
+<p>The function Select (<code><span class='Function'>⊏</span></code>) reorganizes the array <code><span class='Value'>𝕩</span></code> along one or more axes based on <a href="indices.html">indices</a> given by <code><span class='Value'>𝕨</span></code>. The result has the same <a href="depth.html">depth</a> as <code><span class='Value'>𝕩</span></code>, since its elements are always elements of <code><span class='Value'>𝕩</span></code>. This means it differs from Pick (<code><span class='Function'>⊑</span></code>), which takes elements from <code><span class='Value'>𝕩</span></code> but can arrange them in any nested structure, including returning an element directly.</p>
+<p>The monadic form First Cell (<code><span class='Function'>⊏</span></code>) gets the major cell with index 0, so that <code><span class='Function'>⊏</span><span class='Value'>𝕩</span></code> is identical to <code><span class='Number'>0</span><span class='Function'>⊏</span><span class='Value'>𝕩</span></code>.</p>
+<h2 id="single-selection">Single selection</h2>
+<p>Each axis of a BQN array is numbered starting at zero. Major cells are arranged along the first axis; in accordance with the <a href="leading.html">leading axis</a> principle, Select returns a major cell of <code><span class='Value'>𝕩</span></code> when <code><span class='Value'>𝕨</span></code> is an atom.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MiDiio8gImFiY2RlZiIgICMgQW4gZW5jbG9zZWQgZWxlbWVudAoKMiDiipEgImFiY2RlZiIgICMgUGljayBnZXRzIGEgbm9uLWVuY2xvc2VkIGVsZW1lbnQKCjIg4oqPID4ibnVsIuKAvyJvbmUi4oC/InR3byLigL8idHJlIuKAvyJmb3IiCgowIOKKjyA8NSAgIyBObyBmaXJzdCBheGlzIHRvIHNlbGVjdCBmcm9t">↗️</a><pre> <span class='Number'>2</span> <span class='Function'>⊏</span> <span class='String'>&quot;abcdef&quot;</span> <span class='Comment'># An enclosed element
+</span>┌·
+·'c'
+ ┘
+
+ <span class='Number'>2</span> <span class='Function'>⊑</span> <span class='String'>&quot;abcdef&quot;</span> <span class='Comment'># Pick gets a non-enclosed element
+</span>'c'
+
+ <span class='Number'>2</span> <span class='Function'>⊏</span> <span class='Function'>&gt;</span><span class='String'>&quot;nul&quot;</span><span class='Ligature'>‿</span><span class='String'>&quot;one&quot;</span><span class='Ligature'>‿</span><span class='String'>&quot;two&quot;</span><span class='Ligature'>‿</span><span class='String'>&quot;tre&quot;</span><span class='Ligature'>‿</span><span class='String'>&quot;for&quot;</span>
+"two"
+
+ <span class='Number'>0</span> <span class='Function'>⊏</span> <span class='Function'>&lt;</span><span class='Number'>5</span> <span class='Comment'># No first axis to select from
+</span>ERROR
+</pre>
+<p>As a major cell of <code><span class='Value'>𝕩</span></code>, the result has rank one less than it and its shape is <code><span class='Number'>1</span><span class='Function'>↓≢</span><span class='Value'>𝕩</span></code>. <code><span class='Value'>𝕩</span></code> must have rank one or more.</p>
+<p>The index <code><span class='Value'>𝕨</span></code> has to be an integer less than <code><span class='Function'>≠</span><span class='Value'>𝕩</span></code>. It can be negative, in which case it must be greater than or equal to <code><span class='Function'>-≠</span><span class='Value'>𝕩</span></code>. Negative indices select from the end of <code><span class='Value'>𝕩</span></code>, in that <code><span class='Number'>¯1</span></code> indicates the last major cell and <code><span class='Function'>-≠</span><span class='Value'>𝕩</span></code> indicates the first. If <code><span class='Function'>≠</span><span class='Value'>𝕩</span></code> is 0, then no index is valid.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=wq8yIOKKjyAiYWJjZGVmIgoKMCDiio8gIiI=">↗️</a><pre> <span class='Number'>¯2</span> <span class='Function'>⊏</span> <span class='String'>&quot;abcdef&quot;</span>
+┌·
+·'e'
+ ┘
+
+ <span class='Number'>0</span> <span class='Function'>⊏</span> <span class='String'>&quot;&quot;</span>
+ERROR
+</pre>
+<p>The monadic case First Cell (<code><span class='Function'>⊏</span><span class='Value'>𝕩</span></code>) is identical to <code><span class='Number'>0</span><span class='Function'>⊏</span><span class='Value'>𝕩</span></code>. It has the same restrictions: <code><span class='Value'>𝕩</span></code> must have rank 1 or more, and length 1 or more (this differs from First (<code><span class='Function'>⊑</span></code>), which removes the length requirement to return a fill element).</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqPICJhYmMiCgriio8gImFiYyLiiY0iZGVmIgoK4oqPIOKJjSAiYWJjIgoK4oqPICdhJw==">↗️</a><pre> <span class='Function'>⊏</span> <span class='String'>&quot;abc&quot;</span>
+┌·
+·'a'
+ ┘
+
+ <span class='Function'>⊏</span> <span class='String'>&quot;abc&quot;</span><span class='Function'>≍</span><span class='String'>&quot;def&quot;</span>
+"abc"
+
+ <span class='Function'>⊏</span> <span class='Function'>≍</span> <span class='String'>&quot;abc&quot;</span>
+"abc"
+
+ <span class='Function'>⊏</span> <span class='String'>'a'</span>
+ERROR
+</pre>
+<h2 id="first-axis-selection">First-axis selection</h2>
+<p>If <code><span class='Value'>𝕨</span></code> is an array of numbers (including any empty array), then each number indicates a major cell of <code><span class='Value'>𝕩</span></code>. In the simplest case, a list of numbers gives a result with the same rank as <code><span class='Value'>𝕩</span></code> but maybe not the same length.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MuKAvzPigL8z4oC/MOKAvzTigL8xIOKKjyAiT2xaRXQiCgrin6jin6kg4oqPICJPbFpFdCI=">↗️</a><pre> <span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>0</span><span class='Ligature'>‿</span><span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>1</span> <span class='Function'>⊏</span> <span class='String'>&quot;OlZEt&quot;</span>
+"ZEEOtl"
+
+ <span class='Bracket'>⟨⟩</span> <span class='Function'>⊏</span> <span class='String'>&quot;OlZEt&quot;</span>
+⟨⟩
+</pre>
+<p>To find the first and last cells of <code><span class='Value'>𝕩</span></code>, use <code><span class='Number'>0</span><span class='Ligature'>‿</span><span class='Number'>¯1</span></code> for the left argument.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIG0g4oaQIDPigL814oC/N+KAvzExIHzijJwgw5fLnOKGlTcKCjDigL/CrzEg4oqPIG0=">↗️</a><pre> <span class='Function'>⊢</span> <span class='Value'>m</span> <span class='Gets'>←</span> <span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>5</span><span class='Ligature'>‿</span><span class='Number'>7</span><span class='Ligature'>‿</span><span class='Number'>11</span> <span class='Function'>|</span><span class='Modifier'>⌜</span> <span class='Function'>×</span><span class='Modifier'>˜</span><span class='Function'>↕</span><span class='Number'>7</span>
+┌─
+╵ 0 1 1 0 1 1 0
+ 0 1 4 4 1 0 1
+ 0 1 4 2 2 4 1
+ 0 1 4 9 5 3 3
+ ┘
+
+ <span class='Number'>0</span><span class='Ligature'>‿</span><span class='Number'>¯1</span> <span class='Function'>⊏</span> <span class='Value'>m</span>
+┌─
+╵ 0 1 1 0 1 1 0
+ 0 1 4 9 5 3 3
+ ┘
+</pre>
+<p>More generally, <code><span class='Value'>𝕨</span></code> can be an array of any rank. Each of its 0-cells—containing a single number—is replaced with a cell of <code><span class='Value'>𝕩</span></code> in the result. The result's shape is then made up of the shape of <code><span class='Value'>𝕨</span></code> and the major cell shape of <code><span class='Value'>𝕩</span></code>: it's <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>. When <code><span class='Value'>𝕩</span></code> is a list, the result has the same shape as <code><span class='Value'>𝕨</span></code>. Elements of <code><span class='Value'>𝕨</span></code> are replaced one-for-one with elements of <code><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=MnxtCgooMnxtKSDiio8gIiAqIg==">↗️</a><pre> <span class='Number'>2</span><span class='Function'>|</span><span class='Value'>m</span>
+┌─
+╵ 0 1 1 0 1 1 0
+ 0 1 0 0 1 0 1
+ 0 1 0 0 0 0 1
+ 0 1 0 1 1 1 1
+ ┘
+
+ <span class='Paren'>(</span><span class='Number'>2</span><span class='Function'>|</span><span class='Value'>m</span><span class='Paren'>)</span> <span class='Function'>⊏</span> <span class='String'>&quot; *&quot;</span>
+┌─
+╵" ** **
+ * * *
+ * *
+ * ****"
+ ┘
+</pre>
+<p>Another special case is when <code><span class='Value'>𝕨</span></code> is a unit. Now the result shape will be the major cell shape of <code><span class='Value'>𝕩</span></code>. In fact it's the same as the atom case above, that is, for a number <code><span class='Value'>n</span></code>, <code><span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Value'>n</span><span class='Paren'>)</span><span class='Function'>⊏</span><span class='Value'>𝕩</span></code> is the same as <code><span class='Value'>n</span><span class='Function'>⊏</span><span class='Value'>𝕩</span></code>.</p>
+<p>The general case can result in a complicated array. Remember that the initial axes come from <code><span class='Value'>𝕨</span></code> while later ones come from <code><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=ImF3QTAiICvijJwg4oaVNAoKMiDihpUg4oaVNAoKKDIg4oaVIOKGlTQpIOKKjyAiYXdBMCIgK+KMnCDihpU0">↗️</a><pre> <span class='String'>&quot;awA0&quot;</span> <span class='Function'>+</span><span class='Modifier'>⌜</span> <span class='Function'>↕</span><span class='Number'>4</span>
+┌─
+╵"abcd
+ wxyz
+ ABCD
+ 0123"
+ ┘
+
+ <span class='Number'>2</span> <span class='Function'>↕</span> <span class='Function'>↕</span><span class='Number'>4</span>
+┌─
+╵ 0 1
+ 1 2
+ 2 3
+ ┘
+
+ <span class='Paren'>(</span><span class='Number'>2</span> <span class='Function'>↕</span> <span class='Function'>↕</span><span class='Number'>4</span><span class='Paren'>)</span> <span class='Function'>⊏</span> <span class='String'>&quot;awA0&quot;</span> <span class='Function'>+</span><span class='Modifier'>⌜</span> <span class='Function'>↕</span><span class='Number'>4</span>
+┌─
+╎"abcd
+ wxyz
+
+ ·wxyz
+ ABCD
+
+ ·ABCD
+ 0123"
+ ┘
+</pre>
+<h2 id="multi-axis-selection">Multi-axis selection</h2>