aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/pick.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-24 22:47:46 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-24 22:47:46 -0400
commita17782ce2ec31709ce30edb3d96fe2f3a9a6ed1f (patch)
treeb601681b2282f1a51042f8faf5bfe0e0242c0c31 /docs/doc/pick.html
parent436bf368830c828f8008bf55632e2bb4c2a2578f (diff)
Documentation on fill elements
Diffstat (limited to 'docs/doc/pick.html')
-rw-r--r--docs/doc/pick.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/doc/pick.html b/docs/doc/pick.html
index 0926b3a0..b0e99195 100644
--- a/docs/doc/pick.html
+++ b/docs/doc/pick.html
@@ -6,7 +6,7 @@
<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="pick">Pick</h1>
<p>Pick (<code><span class='Function'>⊑</span></code>) chooses elements from <code><span class='Value'>𝕩</span></code> based on <a href="indices.html">index</a> lists from <code><span class='Value'>𝕨</span></code>. <code><span class='Value'>𝕨</span></code> can be a plain list, or even one number if <code><span class='Value'>𝕩</span></code> is a list, in order to get one element from <code><span class='Value'>𝕩</span></code>. It can also be an array of index lists, or have deeper array structure: each index list will be replaced with the element of <code><span class='Value'>𝕩</span></code> at that index, effectively applying to <code><span class='Value'>𝕨</span></code> at <a href="depth.html#the-depth-modifier">depth</a> 1.</p>
-<p>With no <code><span class='Value'>𝕨</span></code>, monadic <code><span class='Function'>⊑</span><span class='Value'>𝕩</span></code> takes the first element of <code><span class='Value'>𝕩</span></code> in index order, or its fill element if <code><span class='Value'>𝕩</span></code> is empty (causing an error if no fill is known).</p>
+<p>With no <code><span class='Value'>𝕨</span></code>, monadic <code><span class='Function'>⊑</span><span class='Value'>𝕩</span></code> takes the first element of <code><span class='Value'>𝕩</span></code> in index order, or its <a href="fill.html">fill element</a> if <code><span class='Value'>𝕩</span></code> is empty (causing an error if no fill is known).</p>
<p>While sometimes &quot;scatter-point&quot; indexing is necessary, using Pick to select multiple elements from <code><span class='Value'>𝕩</span></code> is less array-oriented than <a href="select.html">Select</a> (<code><span class='Function'>⊏</span></code>), and probably slower. Consider rearranging your data so that you can select along axes instead of picking out elements.</p>
<h2 id="one-element">One element</h2>
<p>When the left argument is a number, Pick gets an element from a list:</p>
@@ -55,7 +55,7 @@
<span class='Function'>⊑</span> <span class='Function'>↕</span><span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>5</span><span class='Ligature'>‿</span><span class='Number'>1</span>
⟨ 0 0 0 0 ⟩
</pre>
-<p>If <code><span class='Value'>𝕩</span></code> is empty then Pick always results in an error. First never gives an error: instead it returns the fill element for <code><span class='Value'>𝕩</span></code>.</p>
+<p>If <code><span class='Value'>𝕩</span></code> is empty then Pick always results in an error. First never gives an error: instead it returns the <a href="fill.html">fill element</a> for <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=4oqRICIiCuKKkSDiiaLPgAriipEgMOKGkTzin6giICAiLOKGlTTin6k=">↗️</a><pre> <span class='Function'>⊑</span> <span class='String'>&quot;&quot;</span>
' '
<span class='Function'>⊑</span> <span class='Function'>≢</span><span class='Number'>π</span>