diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-01-06 21:55:23 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-01-06 22:00:24 -0500 |
| commit | abe8ae4745bb2ebe3b71b047aa92e2ae89a414d5 (patch) | |
| tree | a9344b34a666ae7f83693762cb905db9f80e426e | |
| parent | 337044f77dc491459e798625972cd83bed1e72bc (diff) | |
Avoid joining units in some documentation
| -rw-r--r-- | doc/block.md | 2 | ||||
| -rw-r--r-- | doc/functional.md | 2 | ||||
| -rw-r--r-- | doc/group.md | 4 | ||||
| -rw-r--r-- | doc/join.md | 2 | ||||
| -rw-r--r-- | docs/doc/block.html | 4 | ||||
| -rw-r--r-- | docs/doc/functional.html | 2 | ||||
| -rw-r--r-- | docs/doc/group.html | 8 | ||||
| -rw-r--r-- | docs/doc/join.html | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/doc/block.md b/doc/block.md index e565ab17..690f8a27 100644 --- a/doc/block.md +++ b/doc/block.md @@ -39,7 +39,7 @@ Of these, `π£` is sort of a "more special" character, as we'll discuss below. The names `π¨` and `π©`, and their uppercase spellings, represent function arguments. As the argument to a function is typically data, it's more common to use the lowercase forms for these. Either of these names will turn an immediate block into a function (or an immediate modifier into a deferred one; see the next section). Instead of being evaluated as soon as it appears in the source, a function is evaluated when it's called, with the special names set to appropriate values. Unlike in Dyalog APL's dfns, their values can be changed like ordinary variables. {'c'=π©} "abcd" - { π©+β©2 β 0βΎπ© } 3 + { π©+β©2 β 0βπ© } 3 4 { β¨π©β-π¨β© } 5 A function with `π¨` in its definition doesn't have to be called with two arguments. If it has only one, then `π¨` is given the special value Nothing `Β·`. This is the only time a variable can ever be Nothing, as an assignment such as `vβΒ·` is not allowed. diff --git a/doc/functional.md b/doc/functional.md index 49fb0c25..86621699 100644 --- a/doc/functional.md +++ b/doc/functional.md @@ -151,7 +151,7 @@ Like any function, this one can be given a name and then called. A quirk of this Another, and probably more common, use of arrays of functions is to apply several different functions to one or more arguments. Here we apply three different functions to the number 9: - β¨β, 2βΈβΎ, β’-ββ© {ππ©}Β¨ 9 + β¨β, 2βΈβ, β’-ββ© {ππ©}Β¨ 9 The 2-modifier Choose (`βΆ`) relies on arrays of functions toβ¦ function. It's very closely related to Pick `β`, and in fact when the left operand and the elements of the right operand are all data there's no real difference: Choose returns the constant function `πβπ`. diff --git a/doc/group.md b/doc/group.md index 592b868d..4bd82dc2 100644 --- a/doc/group.md +++ b/doc/group.md @@ -72,12 +72,12 @@ The obvious application of Group is to group some values according to a known or If we would like a particular index to key correspondence, we can use a fixed left argument to Index Of. countries β "IT"βΏ"JP"βΏ"NO"βΏ"SU"βΏ"US" - countries βΎΛ co countriesβΈββΈβ ln + countries βΛ co countriesβΈββΈβ ln However, this solution will fail if there are trailing keys with no values. To force the result to have a particular length you can append that length as a dummy index to each argument, then remove the last group after grouping. countries β© "IT"βΏ"JP"βΏ"NO"βΏ"SU"βΏ"US"βΏ"ZW" - countries βΎΛ co countries{πβΈββΈ(Β―1βββ(βΎβ(β π)))} ln + countries βΛ co countries{πβΈββΈ(Β―1βββ(βΎβ(β π)))} ln ### Partitioning diff --git a/doc/join.md b/doc/join.md index 7a0523dd..50a817e7 100644 --- a/doc/join.md +++ b/doc/join.md @@ -49,7 +49,7 @@ Join requires each element of its argument to be an array, and their ranks to ma 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. - β’ m β (3βΏ1βΎβ4βΏ2βΏ5) β₯Β¨ 2βΏ3β₯β6 + β’ m β (3βΏ1ββ4βΏ2βΏ5) β₯Β¨ 2βΏ3β₯β6 βΎ m # Join all that together Join has fairly strict requirements on the shapes of its argument elementsβalthough less strict than those of Merge, which requires they all have identical shape. Suppose the argument to Join has rank `m`. Each of its elements must have the same rank, `n`, which is at least `m`. The trailing shapes `mβββ’Β¨π©` must all be identical (the trailing shape `mββ’βΎπ©` of the result will match these shapes as well). The other entries in the leading shapes need not be the same, but the shape of an element along a particular axis must depend only on the location of the element along that axis in the full array. For a list argument this imposes no restriction, since the one leading shape element is allowed to depend on position along the only axis. But for higher ranks the structure quickly becomes more rigid. diff --git a/docs/doc/block.html b/docs/doc/block.html index 1fcd1dd6..e5652775 100644 --- a/docs/doc/block.html +++ b/docs/doc/block.html @@ -68,9 +68,9 @@ <p>Of these, <code><span class='Value'>π£</span></code> is sort of a "more special" character, as we'll discuss below. Except for <code><span class='Value'>π£</span></code>, every special name is a single character and can't have underscores added to spell it as a modifier, allowing a modifier to be applied to a special name with no spacing as in <code><span class='Value'>π</span><span class='Modifier'>_m</span></code>, something that can't be done with ordinary names.</p> <h3 id="arguments">Arguments</h3> <p>The names <code><span class='Value'>π¨</span></code> and <code><span class='Value'>π©</span></code>, and their uppercase spellings, represent function arguments. As the argument to a function is typically data, it's more common to use the lowercase forms for these. Either of these names will turn an immediate block into a function (or an immediate modifier into a deferred one; see the next section). Instead of being evaluated as soon as it appears in the source, a function is evaluated when it's called, with the special names set to appropriate values. Unlike in Dyalog APL's dfns, their values can be changed like ordinary variables.</p> -<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=eydjJz3wnZWpfSAiYWJjZCIKeyDwnZWpK+KGqTIg4ouEIDDiiL7wnZWpIH0gMwo0IHsg4p+o8J2VqeKLhC3wnZWo4p+pIH0gNQ==">βοΈ</a><pre> <span class='Brace'>{</span><span class='String'>'c'</span><span class='Function'>=</span><span class='Value'>π©</span><span class='Brace'>}</span> <span class='String'>"abcd"</span> +<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=eydjJz3wnZWpfSAiYWJjZCIKeyDwnZWpK+KGqTIg4ouEIDDiiY3wnZWpIH0gMwo0IHsg4p+o8J2VqeKLhC3wnZWo4p+pIH0gNQ==">βοΈ</a><pre> <span class='Brace'>{</span><span class='String'>'c'</span><span class='Function'>=</span><span class='Value'>π©</span><span class='Brace'>}</span> <span class='String'>"abcd"</span> β¨ 0 0 1 0 β© - <span class='Brace'>{</span> <span class='Value'>π©</span><span class='Function'>+</span><span class='Gets'>β©</span><span class='Number'>2</span> <span class='Separator'>β</span> <span class='Number'>0</span><span class='Function'>βΎ</span><span class='Value'>π©</span> <span class='Brace'>}</span> <span class='Number'>3</span> + <span class='Brace'>{</span> <span class='Value'>π©</span><span class='Function'>+</span><span class='Gets'>β©</span><span class='Number'>2</span> <span class='Separator'>β</span> <span class='Number'>0</span><span class='Function'>β</span><span class='Value'>π©</span> <span class='Brace'>}</span> <span class='Number'>3</span> β¨ 0 5 β© <span class='Number'>4</span> <span class='Brace'>{</span> <span class='Bracket'>β¨</span><span class='Value'>π©</span><span class='Separator'>β</span><span class='Function'>-</span><span class='Value'>π¨</span><span class='Bracket'>β©</span> <span class='Brace'>}</span> <span class='Number'>5</span> β¨ 5 Β―4 β© diff --git a/docs/doc/functional.html b/docs/doc/functional.html index fbba17dd..6cf2a402 100644 --- a/docs/doc/functional.html +++ b/docs/doc/functional.html @@ -116,7 +116,7 @@ 0.01831563888873418 </pre> <p>Another, and probably more common, use of arrays of functions is to apply several different functions to one or more arguments. Here we apply three different functions to the number 9:</p> -<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4p+o4oiaLCAy4oq44oi+LCDiiqIt4ouG4p+pIHvwnZWO8J2VqX3CqCA5">βοΈ</a><pre> <span class='Bracket'>β¨</span><span class='Function'>β</span><span class='Separator'>,</span> <span class='Number'>2</span><span class='Modifier2'>βΈ</span><span class='Function'>βΎ</span><span class='Separator'>,</span> <span class='Function'>β’-β</span><span class='Bracket'>β©</span> <span class='Brace'>{</span><span class='Function'>π</span><span class='Value'>π©</span><span class='Brace'>}</span><span class='Modifier'>Β¨</span> <span class='Number'>9</span> +<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4p+o4oiaLCAy4oq44omNLCDiiqIt4ouG4p+pIHvwnZWO8J2VqX3CqCA5">βοΈ</a><pre> <span class='Bracket'>β¨</span><span class='Function'>β</span><span class='Separator'>,</span> <span class='Number'>2</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span><span class='Separator'>,</span> <span class='Function'>β’-β</span><span class='Bracket'>β©</span> <span class='Brace'>{</span><span class='Function'>π</span><span class='Value'>π©</span><span class='Brace'>}</span><span class='Modifier'>Β¨</span> <span class='Number'>9</span> β¨ 3 β¨ 2 9 β© Β―8094.083927575384 β© </pre> <p>The 2-modifier Choose (<code><span class='Modifier2'>βΆ</span></code>) relies on arrays of functions toβ¦ function. It's very closely related to Pick <code><span class='Function'>β</span></code>, and in fact when the left operand and the elements of the right operand are all data there's no real difference: Choose returns the constant function <code><span class='Value'>π</span><span class='Function'>β</span><span class='Value'>π</span></code>.</p> diff --git a/docs/doc/group.html b/docs/doc/group.html index 2240a89c..491fca81 100644 --- a/docs/doc/group.html +++ b/docs/doc/group.html @@ -101,8 +101,8 @@ β </pre> <p>If we would like a particular index to key correspondence, we can use a fixed left argument to Index Of.</p> -<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=Y291bnRyaWVzIOKGkCAiSVQi4oC/IkpQIuKAvyJOTyLigL8iU1Ui4oC/IlVTIgpjb3VudHJpZXMg4oi+y5ggY28gY291bnRyaWVz4oq44oqQ4oq44oqUIGxu">βοΈ</a><pre> <span class='Value'>countries</span> <span class='Gets'>β</span> <span class='String'>"IT"</span><span class='Ligature'>βΏ</span><span class='String'>"JP"</span><span class='Ligature'>βΏ</span><span class='String'>"NO"</span><span class='Ligature'>βΏ</span><span class='String'>"SU"</span><span class='Ligature'>βΏ</span><span class='String'>"US"</span> - <span class='Value'>countries</span> <span class='Function'>βΎ</span><span class='Modifier'>Λ</span> <span class='Value'>co</span> <span class='Value'>countries</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span> <span class='Value'>ln</span> +<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=Y291bnRyaWVzIOKGkCAiSVQi4oC/IkpQIuKAvyJOTyLigL8iU1Ui4oC/IlVTIgpjb3VudHJpZXMg4omNy5ggY28gY291bnRyaWVz4oq44oqQ4oq44oqUIGxu">βοΈ</a><pre> <span class='Value'>countries</span> <span class='Gets'>β</span> <span class='String'>"IT"</span><span class='Ligature'>βΏ</span><span class='String'>"JP"</span><span class='Ligature'>βΏ</span><span class='String'>"NO"</span><span class='Ligature'>βΏ</span><span class='String'>"SU"</span><span class='Ligature'>βΏ</span><span class='String'>"US"</span> + <span class='Value'>countries</span> <span class='Function'>β</span><span class='Modifier'>Λ</span> <span class='Value'>co</span> <span class='Value'>countries</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span> <span class='Value'>ln</span> ββ β΅ "IT" β¨β© "JP" β¨β© @@ -112,8 +112,8 @@ β </pre> <p>However, this solution will fail if there are trailing keys with no values. To force the result to have a particular length you can append that length as a dummy index to each argument, then remove the last group after grouping.</p> -<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=Y291bnRyaWVzIOKGqSAiSVQi4oC/IkpQIuKAvyJOTyLigL8iU1Ui4oC/IlVTIuKAvyJaVyIKY291bnRyaWVzIOKIvsuYIGNvIGNvdW50cmllc3vwnZWX4oq44oqQ4oq4KMKvMeKGk+KKlOKXiyjiiL7in5wo4omg8J2VlykpKX0gbG4=">βοΈ</a><pre> <span class='Value'>countries</span> <span class='Gets'>β©</span> <span class='String'>"IT"</span><span class='Ligature'>βΏ</span><span class='String'>"JP"</span><span class='Ligature'>βΏ</span><span class='String'>"NO"</span><span class='Ligature'>βΏ</span><span class='String'>"SU"</span><span class='Ligature'>βΏ</span><span class='String'>"US"</span><span class='Ligature'>βΏ</span><span class='String'>"ZW"</span> - <span class='Value'>countries</span> <span class='Function'>βΎ</span><span class='Modifier'>Λ</span> <span class='Value'>co</span> <span class='Value'>countries</span><span class='Brace'>{</span><span class='Value'>π</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span><span class='Modifier2'>βΈ</span><span class='Paren'>(</span><span class='Number'>Β―1</span><span class='Function'>ββ</span><span class='Modifier2'>β</span><span class='Paren'>(</span><span class='Function'>βΎ</span><span class='Modifier2'>β</span><span class='Paren'>(</span><span class='Function'>β </span><span class='Value'>π</span><span class='Paren'>)))</span><span class='Brace'>}</span> <span class='Value'>ln</span> +<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=Y291bnRyaWVzIOKGqSAiSVQi4oC/IkpQIuKAvyJOTyLigL8iU1Ui4oC/IlVTIuKAvyJaVyIKY291bnRyaWVzIOKJjcuYIGNvIGNvdW50cmllc3vwnZWX4oq44oqQ4oq4KMKvMeKGk+KKlOKXiyjiiL7in5wo4omg8J2VlykpKX0gbG4=">βοΈ</a><pre> <span class='Value'>countries</span> <span class='Gets'>β©</span> <span class='String'>"IT"</span><span class='Ligature'>βΏ</span><span class='String'>"JP"</span><span class='Ligature'>βΏ</span><span class='String'>"NO"</span><span class='Ligature'>βΏ</span><span class='String'>"SU"</span><span class='Ligature'>βΏ</span><span class='String'>"US"</span><span class='Ligature'>βΏ</span><span class='String'>"ZW"</span> + <span class='Value'>countries</span> <span class='Function'>β</span><span class='Modifier'>Λ</span> <span class='Value'>co</span> <span class='Value'>countries</span><span class='Brace'>{</span><span class='Value'>π</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span><span class='Modifier2'>βΈ</span><span class='Paren'>(</span><span class='Number'>Β―1</span><span class='Function'>ββ</span><span class='Modifier2'>β</span><span class='Paren'>(</span><span class='Function'>βΎ</span><span class='Modifier2'>β</span><span class='Paren'>(</span><span class='Function'>β </span><span class='Value'>π</span><span class='Paren'>)))</span><span class='Brace'>}</span> <span class='Value'>ln</span> ββ β΅ "IT" β¨β© "JP" β¨β© diff --git a/docs/doc/join.html b/docs/doc/join.html index 62f478ee..d9cac584 100644 --- a/docs/doc/join.html +++ b/docs/doc/join.html @@ -67,7 +67,7 @@ ERROR </span>ERROR </pre> <p>However, Join has higher-dimensional uses as well. Given a rank-<code><span class='Value'>m</span></code> array of rank-<code><span class='Value'>n</span></code> arrays (requiring <code><span class='Value'>m</span><span class='Function'>β€</span><span class='Value'>n</span></code>), it will merge arrays along their first <code><span class='Value'>m</span></code> axes. For example, if the argument is a matrix of matrices representing a <a href="https://en.wikipedia.org/wiki/Block_matrix">block matrix</a>, Join will give the corresponding unblocked matrix as its result.</p> -<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIG0g4oaQICgz4oC/MeKIvuKMnDTigL8y4oC/NSkg4qWKwqggMuKAvzPipYrihpU2CuKIviBtICAjIEpvaW4gYWxsIHRoYXQgdG9nZXRoZXI=">βοΈ</a><pre> <span class='Function'>β’</span> <span class='Value'>m</span> <span class='Gets'>β</span> <span class='Paren'>(</span><span class='Number'>3</span><span class='Ligature'>βΏ</span><span class='Number'>1</span><span class='Function'>βΎ</span><span class='Modifier'>β</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='Paren'>)</span> <span class='Function'>β₯</span><span class='Modifier'>Β¨</span> <span class='Number'>2</span><span class='Ligature'>βΏ</span><span class='Number'>3</span><span class='Function'>β₯β</span><span class='Number'>6</span> +<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIG0g4oaQICgz4oC/MeKJjeKMnDTigL8y4oC/NSkg4qWKwqggMuKAvzPipYrihpU2CuKIviBtICAjIEpvaW4gYWxsIHRoYXQgdG9nZXRoZXI=">βοΈ</a><pre> <span class='Function'>β’</span> <span class='Value'>m</span> <span class='Gets'>β</span> <span class='Paren'>(</span><span class='Number'>3</span><span class='Ligature'>βΏ</span><span class='Number'>1</span><span class='Function'>β</span><span class='Modifier'>β</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='Paren'>)</span> <span class='Function'>β₯</span><span class='Modifier'>Β¨</span> <span class='Number'>2</span><span class='Ligature'>βΏ</span><span class='Number'>3</span><span class='Function'>β₯β</span><span class='Number'>6</span> ββ β΅ ββ ββ ββ β΅ 0 0 0 0 β΅ 1 1 β΅ 2 2 2 2 2 |
