diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-04-27 22:21:50 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-04-27 22:21:50 -0400 |
| commit | 31b722e16e6a0f6b0f08e8409b2c7e240937bfed (patch) | |
| tree | 409d3fde73f45aace8ce1c224dd7f5514f1ff4d0 /docs/doc/replicate.html | |
| parent | 3b44787d5b7508a5abd868c7891046576e0eab02 (diff) | |
Documentation for Under
Diffstat (limited to 'docs/doc/replicate.html')
| -rw-r--r-- | docs/doc/replicate.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/doc/replicate.html b/docs/doc/replicate.html index 1b2c461f..31e63228 100644 --- a/docs/doc/replicate.html +++ b/docs/doc/replicate.html @@ -86,7 +86,7 @@ </svg> <p>The functions Indices and Replicate are used to copy or filter data. They might be described as transforming a <a href="https://en.wikipedia.org/wiki/Run-length_encoding">run-length encoding</a> into unencoded form. On the other hand, Indices might be described as giving a sparse representation of <code><span class='Value'>𝕩</span></code>, which is smaller if <code><span class='Value'>𝕩</span></code> mostly consists of zeros.</p> -<p>BQN doesn't have any of the various features used in APL to add fills to the result of Replicate, like negative numbers in <code><span class='Value'>𝕨</span></code> or an Expand (<code><span class='Value'>\</span></code>) primitive. An alternative to Expand is to use Replicate with structural Under (<code><span class='Modifier2'>⌾</span></code>) to insert values into an array of fills.</p> +<p>BQN doesn't have any of the various features used in APL to add fills to the result of Replicate, like negative numbers in <code><span class='Value'>𝕨</span></code> or an Expand (<code><span class='Value'>\</span></code>) primitive. An alternative to Expand is to use Replicate with structural <a href="under.html">Under</a> (<code><span class='Modifier2'>⌾</span></code>) to insert values into an array of fills.</p> <h2 id="replicate"><a class="header" href="#replicate">Replicate</a></h2> <p>Given a list of natural numbers <code><span class='Value'>𝕨</span></code>, Replicate repeats each major cell in <code><span class='Value'>𝕩</span></code> the corresponding number of times. That is, <code><span class='Value'>𝕨</span></code> and <code><span class='Value'>𝕩</span></code> must have the same length, and the result includes <code><span class='Value'>i</span><span class='Function'>⊑</span><span class='Value'>𝕨</span></code> copies of each cell <code><span class='Value'>i</span><span class='Function'>⊏</span><span class='Value'>𝕩</span></code>, in order.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MuKAvzHigL8w4oC/MiAvICJhYmNkIgoK4oqiIGEg4oaQID4iYWEwIuKAvyJiYjEi4oC/ImNjMiLigL8iZGQzIgoKMuKAvzHigL8w4oC/MiAvIGE=">↗️</a><pre> <span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>0</span><span class='Ligature'>‿</span><span class='Number'>2</span> <span class='Function'>/</span> <span class='String'>"abcd"</span> |
