From b2374aef747b4988417f896fdf33852dd57b9b07 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 3 Feb 2021 13:43:13 -0500 Subject: Rename Unique Mask to Mark Firsts --- docs/commentary/problems.html | 2 +- docs/doc/leading.html | 2 +- docs/doc/primitive.html | 2 +- docs/doc/train.html | 2 +- docs/repl.js | 2 +- docs/spec/inferred.html | 2 +- docs/spec/primitive.html | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'docs') 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 @@

Empty left argument to Select

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.

Unclear primitive names

-

Blanket issue for names that I don't find informative: "Solo", "Bins", "Unique Mask", "Find", and "Group".

+

Blanket issue for names that I don't find informative: "Solo", "Bins", "Find", and "Group".

Strands go left to right

This is the best ordering, since it's consistent with lists. And code in a strand probably shouldn't have side effects anyway. Still, it's an odd little tack-on to say separators and strands go left to right, and it complicates the implementation a little.

Should have a rounding function

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 @@ ⟨ 3 2 1 ⟩

Comparing cells

-

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 ⍋⍒, and the self-comparison functions Unique Mask () and Occurrence Count (), 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.

+

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 ⍋⍒, and the self-comparison functions Classify (), Mark Firsts (), and Occurrence Count (), 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.

↗️
    s  "abracadabra"
      s
 ⟨ 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 @@
 
 
 
-Unique Mask
+Mark Firsts
 Member of
 
 
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 @@
 

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 ¯1 above only occur as left arguments, so they can also serve as anchors).

Practice training

-

The train ⊢>¯1»⌈` is actually a nice trick for getting the unique mask 𝕩 from the self-classify 𝕩 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.

+

The train ⊢>¯1»⌈` is actually a nice trick for marking first occurrences 𝕩 given the self-classify 𝕩 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.

( > ¯1 » `) 𝕩
 (𝕩) > (¯1) » (`𝕩)
 𝕩 > ¯1 » `𝕩
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_fMerge;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_fMerge;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 @@
 
 
 k𝔽𝔾
-𝔾k𝔽
+𝔾{𝕨𝔽𝔾𝕩}(k𝔽)
 Constant k
 
 
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 @@
 

Range () 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 𝕩 should still result in an error). For a list 𝕩, the result is an array of shape 𝕩 in which the value at a given index is that index, as a list of natural numbers. That is, ii⊑↕𝕩 for any list of natural numbers i with ´i<𝕩.

Searching

Match () 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 =, 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. Not Match simply returns the complement of Match, ¬≡.

-

Monadic search functions compare the major cells of 𝕩 to each other. 𝕩 must have rank at least 1. Except for Unique (), the result is a list of numbers with the same length as 𝕩.

+

Monadic search functions compare the major cells of 𝕩 to each other. 𝕩 must have rank at least 1. Except for Deduplicate (), the result is a list of numbers with the same length as 𝕩.

    -
  • Unique Mask () returns 1 for a cell if it doesn't match any earlier cell and 0 if it does.
  • +
  • Mark Firsts () returns 1 for a cell if it doesn't match any earlier cell and 0 if it does.
  • Deduplicate () filters major cells to remove duplicates, retaining the ordering given by the first appearance of each unique cell.
  • Classify () returns, for each cell, the smallest index of a cell that matches it (it's necessarily less than or equal to ↕≠𝕩 element-wise, since each cell matches itself).
  • Occurrence Count () returns the number of earlier cells matching each cell.
  • -- cgit v1.2.3