diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-03 13:43:13 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-03 15:24:53 -0500 |
| commit | b2374aef747b4988417f896fdf33852dd57b9b07 (patch) | |
| tree | e04294eeefecca837026b82c2e8e96ff564d011e /docs | |
| parent | ad582b5ef4184e26be86ef61be60c28e90b0bb7d (diff) | |
Rename Unique Mask to Mark Firsts
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/commentary/problems.html | 2 | ||||
| -rw-r--r-- | docs/doc/leading.html | 2 | ||||
| -rw-r--r-- | docs/doc/primitive.html | 2 | ||||
| -rw-r--r-- | docs/doc/train.html | 2 | ||||
| -rw-r--r-- | docs/repl.js | 2 | ||||
| -rw-r--r-- | docs/spec/inferred.html | 2 | ||||
| -rw-r--r-- | docs/spec/primitive.html | 4 |
7 files changed, 8 insertions, 8 deletions
diff --git a/docs/commentary/problems.html b/docs/commentary/problems.html index d42a99b6..150d946d 100644 --- a/docs/commentary/problems.html +++ b/docs/commentary/problems.html @@ -138,7 +138,7 @@ <h3 id="empty-left-argument-to-select">Empty left argument to Select</h3> <p>Select chooses whether the left argument maps to right argument axes or selects from the first axis only based on its depth. Without prototypes an empty array has depth 1, so it selects no major cells. However, it could also select from no axes (a no-op) and in some contexts the other behavior would be surprising.</p> <h3 id="unclear-primitive-names">Unclear primitive names</h3> -<p>Blanket issue for names that I don't find informative: "Solo", "Bins", "Unique Mask", "Find", and "Group".</p> +<p>Blanket issue for names that I don't find informative: "Solo", "Bins", "Find", and "Group".</p> <h3 id="strands-go-left-to-right">Strands go left to right</h3> <p>This is the best ordering, since it's consistent with <code><span class='Bracket'>⟨</span><span class='Separator'>⋄</span><span class='Bracket'>⟩</span></code> lists. And code in a strand probably shouldn't have side effects anyway. Still, it's an odd little tack-on to say separators <em>and strands</em> go left to right, and it complicates the implementation a little.</p> <h3 id="should-have-a-rounding-function">Should have a rounding function</h3> diff --git a/docs/doc/leading.html b/docs/doc/leading.html index 45f0a83a..e7fd7fcb 100644 --- a/docs/doc/leading.html +++ b/docs/doc/leading.html @@ -81,7 +81,7 @@ </span>⟨ 3 2 1 ⟩ </pre> <h3 id="comparing-cells">Comparing cells</h3> -<p>The functions in the last section manipulate cells in the same way regardless of what data they contain. Other functions compare cells to each other, either testing whether they match or how they are ordered relative to one another. The two Grade functions <code><span class='Function'>⍋⍒</span></code>, and the self-comparison functions Unique Mask (<code><span class='Function'>∊</span></code>) and Occurrence Count (<code><span class='Function'>⊒</span></code>), each give a list result, with one number for each cell. We can see below that Occurrence Count returns the same results even as we make the argument cells more complicated, because the changes made preserve the matching of cells.</p> +<p>The functions in the last section manipulate cells in the same way regardless of what data they contain. Other functions compare cells to each other, either testing whether they match or how they are ordered relative to one another. The two Grade functions <code><span class='Function'>⍋⍒</span></code>, and the self-comparison functions Classify (<code><span class='Function'>⊐</span></code>), Mark Firsts (<code><span class='Function'>∊</span></code>), and Occurrence Count (<code><span class='Function'>⊒</span></code>), each give a list result, with one number for each cell. We can see below that Occurrence Count returns the same results even as we make the argument cells more complicated, because the changes made preserve the matching of cells.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=cyDihpAgImFicmFjYWRhYnJhIgriipIgcwriipIg4omNy5ggcwriipIgcyDiiL7ijokw4oC/MSAic3VmZml4Ig==">↗️</a><pre> <span class='Value'>s</span> <span class='Gets'>←</span> <span class='String'>"abracadabra"</span> <span class='Function'>⊒</span> <span class='Value'>s</span> ⟨ 0 0 0 1 0 2 0 3 1 1 4 ⟩ diff --git a/docs/doc/primitive.html b/docs/doc/primitive.html index a77ae4e6..c9259a96 100644 --- a/docs/doc/primitive.html +++ b/docs/doc/primitive.html @@ -214,7 +214,7 @@ </tr> <tr> <td><code><span class='Function'>∊</span></code></td> -<td><a href="https://aplwiki.com/wiki/Nub_Sieve">Unique Mask</a></td> +<td><a href="https://aplwiki.com/wiki/Nub_Sieve">Mark Firsts</a></td> <td><a href="https://aplwiki.com/wiki/Membership">Member of</a></td> </tr> <tr> diff --git a/docs/doc/train.html b/docs/doc/train.html index 4ae23b13..23348229 100644 --- a/docs/doc/train.html +++ b/docs/doc/train.html @@ -41,7 +41,7 @@ </pre> <p>In a train, arguments alternate strictly with combining functions between them. Arguments can be either functions or subjects, except for the rightmost one, which has to be a function to indicate that the expression is a train. Trains tend to be shorter than subject expressions partly because to keep track of this alternation in a train of all functions, you need to know where each function is relative to the end of the train (subjects like the <code><span class='Number'>¯1</span></code> above only occur as left arguments, so they can also serve as anchors).</p> <h2 id="practice-training">Practice training</h2> -<p>The train <code><span class='Function'>⊢></span><span class='Number'>¯1</span><span class='Function'>»⌈</span><span class='Modifier'>`</span></code> is actually a nice trick for getting the unique mask <code><span class='Function'>∊</span><span class='Value'>𝕩</span></code> from the self-classify <code><span class='Function'>⊐</span><span class='Value'>𝕩</span></code> without doing another search. Let's take a closer look, first by applying it mechanically. To do this, we apply each "argument" to the train's argument, and then combine them with the combining functions.</p> +<p>The train <code><span class='Function'>⊢></span><span class='Number'>¯1</span><span class='Function'>»⌈</span><span class='Modifier'>`</span></code> is actually a nice trick for marking first occurrences <code><span class='Function'>∊</span><span class='Value'>𝕩</span></code> given the self-classify <code><span class='Function'>⊐</span><span class='Value'>𝕩</span></code> without doing another search. Let's take a closer look, first by applying it mechanically. To do this, we apply each "argument" to the train's argument, and then combine them with the combining functions.</p> <pre><span class='Paren'>(</span><span class='Function'>⊢</span> <span class='Function'>></span> <span class='Number'>¯1</span> <span class='Function'>»</span> <span class='Function'>⌈</span><span class='Modifier'>`</span><span class='Paren'>)</span> <span class='Value'>𝕩</span> <span class='Paren'>(</span><span class='Function'>⊢</span><span class='Value'>𝕩</span><span class='Paren'>)</span> <span class='Function'>></span> <span class='Paren'>(</span><span class='Number'>¯1</span><span class='Paren'>)</span> <span class='Function'>»</span> <span class='Paren'>(</span><span class='Function'>⌈</span><span class='Modifier'>`</span><span class='Value'>𝕩</span><span class='Paren'>)</span> <span class='Value'>𝕩</span> <span class='Function'>></span> <span class='Number'>¯1</span> <span class='Function'>»</span> <span class='Function'>⌈</span><span class='Modifier'>`</span><span class='Value'>𝕩</span> diff --git a/docs/repl.js b/docs/repl.js index 2a54becd..7447accd 100644 --- a/docs/repl.js +++ b/docs/repl.js @@ -89,7 +89,7 @@ let typeChar = (t, c, ev) => { } let syncls={ v:"Value", f:"Function", m:"Modifier", d:"Modifier2", n:"Number", g:"Gets", p:"Paren", b:"Bracket", k:"Brace", l:"Ligature", n:"Nothing", s:"Separator", c:"Comment", a:"String" }; -let keydesc='f+Conjugate;Add_f-Negate;Subtract_f×Sign;Multiply_f÷Reciprocal;Divide_f⋆Exponential;Power_f√Square Root;Root_f⌊Floor;Minimum_f⌈Ceiling;Maximum_f∧Sort Up;And_f∨Sort Down;Or_f¬Not;Span_f|Absolute Value;Modulus_f≤Less Than or Equal to_f<Enclose;Less Than_f>Merge;Greater Than_f≥Greater Than or Equal to_f=Rank;Equals_f≠Length;Not Equals_f≡Depth;Match_f≢Shape;Not Match_f⊣Identity;Left_f⊢Identity;Right_f⥊Deshape;Reshape_f∾Join;Join to_f≍Solo;Couple_f↑Prefixes;Take_f↓Suffixes;Drop_f↕Range;Windows_f«Shift Before_f»Shift After_f⌽Reverse;Rotate_f⍉Transpose;Reorder axes_f/Indices;Replicate_f⍋Grade Up;Bins Up_f⍒Grade Down;Bins Down_f⊏First Cell;Select_f⊑First;Pick_f⊐Index of_f⊒Occurrence Count;Progressive Index of_f∊Unique Mask;Member of_f⍷Deduplicate;Find_f⊔Group Indices;Group_f!Assert;Assert with message_m˙Constant_m˜Self/Swap_d∘Atop_d○Over_d⊸Before/Bind_d⟜After/Bind_d⌾Under_d⊘Valences_d◶Choose_d⎉Rank_m˘Cells_d⚇Depth_m¨Each_m⌜Table_d⍟Repeat_m⁼Undo_m´Fold_m˝Insert_m`Scan_g←Define_g⇐Export_g↩Change_g→Return_s⋄Separator_s,Separator_p(Begin expression_p)End expression_k{Begin block_k}End block_b⟨Begin list_b⟩End list_l‿Strand_n·Nothing_v•System_v𝕨Left argument_f𝕎Left argument (as function)_v𝕩Right argument_f𝕏Right argument (as function)_v𝕗Modifier left operand (as subject)_f𝔽Modifier left operand_v𝕘2-modifier right operand (as subject)_f𝔾2-modifier right operand_v𝕤Current function (as subject)_f𝕊Current function_m𝕣Current modifier_n¯Minus_nπPi_n∞Infinity_a@Null character_c#Comment'.split(/[\n_]/); +let keydesc='f+Conjugate;Add_f-Negate;Subtract_f×Sign;Multiply_f÷Reciprocal;Divide_f⋆Exponential;Power_f√Square Root;Root_f⌊Floor;Minimum_f⌈Ceiling;Maximum_f∧Sort Up;And_f∨Sort Down;Or_f¬Not;Span_f|Absolute Value;Modulus_f≤Less Than or Equal to_f<Enclose;Less Than_f>Merge;Greater Than_f≥Greater Than or Equal to_f=Rank;Equals_f≠Length;Not Equals_f≡Depth;Match_f≢Shape;Not Match_f⊣Identity;Left_f⊢Identity;Right_f⥊Deshape;Reshape_f∾Join;Join to_f≍Solo;Couple_f↑Prefixes;Take_f↓Suffixes;Drop_f↕Range;Windows_f«Shift Before_f»Shift After_f⌽Reverse;Rotate_f⍉Transpose;Reorder axes_f/Indices;Replicate_f⍋Grade Up;Bins Up_f⍒Grade Down;Bins Down_f⊏First Cell;Select_f⊑First;Pick_f⊐Classify;Index of_f⊒Occurrence Count;Progressive Index of_f∊Mark First;Member of_f⍷Deduplicate;Find_f⊔Group Indices;Group_f!Assert;Assert with message_m˙Constant_m˜Self/Swap_d∘Atop_d○Over_d⊸Before/Bind_d⟜After/Bind_d⌾Under_d⊘Valences_d◶Choose_d⎉Rank_m˘Cells_d⚇Depth_m¨Each_m⌜Table_d⍟Repeat_m⁼Undo_m´Fold_m˝Insert_m`Scan_g←Define_g⇐Export_g↩Change_g→Return_s⋄Separator_s,Separator_p(Begin expression_p)End expression_k{Begin block_k}End block_b⟨Begin list_b⟩End list_l‿Strand_n·Nothing_v•System_v𝕨Left argument_f𝕎Left argument (as function)_v𝕩Right argument_f𝕏Right argument (as function)_v𝕗Modifier left operand (as subject)_f𝔽Modifier left operand_v𝕘2-modifier right operand (as subject)_f𝔾2-modifier right operand_v𝕤Current function (as subject)_f𝕊Current function_m𝕣Current modifier_n¯Minus_nπPi_n∞Infinity_a@Null character_c#Comment'.split(/[\n_]/); let kk=Array.from('`123456890-=~!@#$%^&*()_+qwertuiop[]QWERTIOP{}asdfghjkl;ASFGHKL:"zxcvbm,./XVBM<>? \''); let kv=Array.from('˜˘¨⁼⌜´˝∞¯•÷׬⎉⚇⍟◶⊘⎊⍎⍕⟨⟩√⋆⌽𝕨∊↑∧⊔⊏⊐π←→↙𝕎⍷𝕣⍋⊑⊒⍳⊣⊢⍉𝕤↕𝕗𝕘⊸∘○⟜⋄↖𝕊𝔽𝔾«⌾»·˙⥊𝕩↓∨⌊≡∾≍≠𝕏⍒⌈≢≤≥⇐‿↩'); let keys={}, revkeys={}, primhelp={}; diff --git a/docs/spec/inferred.html b/docs/spec/inferred.html index 33470f4f..79d6e00d 100644 --- a/docs/spec/inferred.html +++ b/docs/spec/inferred.html @@ -450,7 +450,7 @@ </tr> <tr> <td><code><span class='Value'>k</span><span class='Function'>𝔽𝔾</span></code></td> -<td><code><span class='Function'>𝔾</span><span class='Modifier'>⁼</span><span class='Value'>k</span><span class='Function'>𝔽</span><span class='Modifier'>⁼</span><span class='Function'>⊢</span></code></td> +<td><code><span class='Function'>𝔾</span><span class='Modifier'>⁼</span><span class='Brace'>{</span><span class='Value'>𝕨</span><span class='Function'>𝔽𝔾</span><span class='Value'>𝕩</span><span class='Brace'>}</span><span class='Paren'>(</span><span class='Value'>k</span><span class='Function'>𝔽</span><span class='Modifier'>⁼</span><span class='Function'>⊢</span><span class='Paren'>)</span></code></td> <td>Constant <code><span class='Value'>k</span></code></td> </tr> <tr> diff --git a/docs/spec/primitive.html b/docs/spec/primitive.html index db1b7e02..e59188d1 100644 --- a/docs/spec/primitive.html +++ b/docs/spec/primitive.html @@ -129,9 +129,9 @@ <p><strong>Range</strong> (<code><span class='Function'>↕</span></code>) is extended to apply to a list of natural numbers, in addition to the provided case of a single natural number (an enclosed natural number <code><span class='Value'>𝕩</span></code> should still result in an error). For a list <code><span class='Value'>𝕩</span></code>, the result is an array of shape <code><span class='Value'>𝕩</span></code> in which the value at a given index is that index, as a list of natural numbers. That is, <code><span class='Value'>i</span><span class='Function'>≡</span><span class='Value'>i</span><span class='Function'>⊑↕</span><span class='Value'>𝕩</span></code> for any list of natural numbers <code><span class='Value'>i</span></code> with <code><span class='Function'>∧</span><span class='Modifier'>´</span><span class='Value'>i</span><span class='Function'><</span><span class='Value'>𝕩</span></code>.</p> <h3 id="searching">Searching</h3> <p><strong>Match</strong> (<code><span class='Function'>≡</span></code>) indicates whether two values are considered equivalent. It always returns 0 or 1, and never causes an error. If both arguments are atoms then it is identical to <code><span class='Function'>=</span></code>, and if one is an atom and the other an array then it returns 0. If both arguments are arrays then it returns 1 only if they have the same shape and all pairs of corresponding elements match. Fill elements aren't taken into account, so that arrays that match might still differ in behavior. <strong>Not Match</strong> simply returns the complement of Match, <code><span class='Function'>¬≡</span></code>.</p> -<p>Monadic search functions compare the major cells of <code><span class='Value'>𝕩</span></code> to each other. <code><span class='Value'>𝕩</span></code> must have rank at least 1. Except for Unique (<code><span class='Function'>⍷</span></code>), the result is a list of numbers with the same length as <code><span class='Value'>𝕩</span></code>.</p> +<p>Monadic search functions compare the major cells of <code><span class='Value'>𝕩</span></code> to each other. <code><span class='Value'>𝕩</span></code> must have rank at least 1. Except for Deduplicate (<code><span class='Function'>⍷</span></code>), the result is a list of numbers with the same length as <code><span class='Value'>𝕩</span></code>.</p> <ul> -<li><strong>Unique Mask</strong> (<code><span class='Function'>∊</span></code>) returns 1 for a cell if it doesn't match any earlier cell and 0 if it does.</li> +<li><strong>Mark Firsts</strong> (<code><span class='Function'>∊</span></code>) returns 1 for a cell if it doesn't match any earlier cell and 0 if it does.</li> <li><strong>Deduplicate</strong> (<code><span class='Function'>⍷</span></code>) filters major cells to remove duplicates, retaining the ordering given by the first appearance of each unique cell.</li> <li><strong>Classify</strong> (<code><span class='Function'>⊐</span></code>) returns, for each cell, the smallest index of a cell that matches it (it's necessarily less than or equal to <code><span class='Function'>↕≠</span><span class='Value'>𝕩</span></code> element-wise, since each cell matches itself).</li> <li><strong>Occurrence Count</strong> (<code><span class='Function'>⊒</span></code>) returns the number of earlier cells matching each cell.</li> |
