diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-06 22:18:20 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-06 22:18:20 -0400 |
| commit | 4d602ea36183e62e463cea08900a16ea6240a03f (patch) | |
| tree | f21aef763d907d7e1b093cf633c544cfcdd0a085 /docs/doc/identity.html | |
| parent | 97e31a20cefe21c1627f33057d20d7970511754f (diff) | |
Editing and links
Diffstat (limited to 'docs/doc/identity.html')
| -rw-r--r-- | docs/doc/identity.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/doc/identity.html b/docs/doc/identity.html index f865e960..196b219c 100644 --- a/docs/doc/identity.html +++ b/docs/doc/identity.html @@ -21,7 +21,7 @@ <p>Depending on your past experiences, this could cause some confusion: built-in support for functions that do nothing? Documentation should say why a feature's there and how to use it, not just what it does, so we'll try to address this below. The most important single use is for tacit programming, but there are a variety of other uses as well.</p> <p>Of course, it's easy to write block functions <code><span class='Brace'>{</span><span class='Value'>๐ฉ</span><span class='Brace'>}</span></code> and <code><span class='Brace'>{</span><span class='Value'>๐จ</span><span class='Brace'>}</span></code> that return particular arguments. While I would already make <code><span class='Function'>โฃ</span></code> and <code><span class='Function'>โข</span></code> primitives just because they are common and important, there are also specific disadvantages to using blocks. They fail to indicate that there are no side effects, as primitives would, and they also need special casing for the interpreter to manipulate them when applying Undo (<code><span class='Modifier'>โผ</span></code>) or making other inferences.</p> <h2 id="filling-arrays">Filling arrays</h2> -<p>What's the easiest way to create a matrix with 0 on the first row, 1 on the second, and so on? Probably this one, with <a href="map.html">table</a>:</p> +<p>What's the easiest way to create a matrix with 0 on the first row, 1 on the second, and so on? Probably this one, with <a href="map.html#table">table</a>:</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KOKGlTQpIOKKo+KMnCDihpU1">โ๏ธ</a><pre> <span class='Paren'>(</span><span class='Function'>โ</span><span class='Number'>4</span><span class='Paren'>)</span> <span class='Function'>โฃ</span><span class='Modifier'>โ</span> <span class='Function'>โ</span><span class='Number'>5</span> โโ โต 0 0 0 0 0 @@ -30,7 +30,7 @@ 3 3 3 3 3 โ </pre> -<p>The right argument <code><span class='Function'>โ</span><span class='Number'>5</span></code> could be any length-5 list, as its values aren't used. With <code><span class='Number'>5</span><span class='Function'>โฅ</span><span class='Number'>0</span></code>, we could use <code><span class='Function'>+</span><span class='Modifier'>โ</span></code> instead, but requiring a specific argument seems artificial. A similar pattern applies with Each:</p> +<p>The right argument <code><span class='Function'>โ</span><span class='Number'>5</span></code> could be any length-5 list, as its values aren't used. With <code><span class='Number'>5</span><span class='Function'>โฅ</span><span class='Number'>0</span></code>, we could use <code><span class='Function'>+</span><span class='Modifier'>โ</span></code> instead, but requiring a specific argument seems artificial. A similar pattern applies with <a href="map.html#each">Each</a>:</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KOKMveKGlTQpIOKKo8KoIOKGlTTigL81">โ๏ธ</a><pre> <span class='Paren'>(</span><span class='Function'>โฝโ</span><span class='Number'>4</span><span class='Paren'>)</span> <span class='Function'>โฃ</span><span class='Modifier'>ยจ</span> <span class='Function'>โ</span><span class='Number'>4</span><span class='Ligature'>โฟ</span><span class='Number'>5</span> โโ โต 3 3 3 3 3 |
