aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rwxr-xr-xc.bqn10
-rw-r--r--doc/context.md2
-rw-r--r--doc/fromDyalog.md8
-rw-r--r--doc/group.md6
-rw-r--r--doc/transpose.md2
-rw-r--r--doc/windows.md4
-rw-r--r--docs/doc/context.html2
-rw-r--r--docs/doc/fromDyalog.html8
-rw-r--r--docs/doc/group.html6
-rw-r--r--docs/doc/transpose.html2
-rw-r--r--docs/doc/windows.html4
-rw-r--r--docs/index.html6
-rw-r--r--docs/problems.html16
-rw-r--r--docs/spec/token.html2
-rwxr-xr-xdzref13
-rw-r--r--examples/fifty.bqn6
-rw-r--r--md.bqn10
-rw-r--r--problems.md16
-rw-r--r--spec/reference.bqn11
-rw-r--r--spec/token.md2
21 files changed, 77 insertions, 60 deletions
diff --git a/README.md b/README.md
index 84e8c0a1..2555acd8 100644
--- a/README.md
+++ b/README.md
@@ -159,6 +159,7 @@ Other modifiers control array traversal and iteration. In three cases a simpler
`⌜` | Table |
`⁼` | Undo | `⍟` | Repeat
`´` | Reduce |
+`˝` | Insert |
`` ` `` | Scan |
## Literal notation
diff --git a/c.bqn b/c.bqn
index 13252655..30525216 100755
--- a/c.bqn
+++ b/c.bqn
@@ -3,7 +3,7 @@
nl‿tab←•UCS 10‿9
charSet←∾charGroups←⟨
chF←"+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!" # Function
- "˜˘¨⌜⁼´`" # Modifier
+ "˜˘¨⌜⁼´˝`" # Modifier
"∘○⊸⟜⌾⊘◶⎉⚇⍟" # Composition
¯1⊏˘10‿2⥊"𝕨𝕎𝕩𝕏𝕗𝔽𝕘𝔾𝕤𝕊" # Input (𝕣 pending; ℝ not allowed)
nl∾"⋄," # Separator
@@ -79,7 +79,7 @@ GenF64←{
l←2(⌊⋆⁼)𝕩
(Hex"44")∾2 Base˘8‿8⥊∾⟨¯52↑(0⌈l)Enc2𝕩,11 Enc2 1023+l,⥊0⟩
}
-MakeTab←{{⊑∘(∾⟜0)¨¯1↓(chF⊐𝕨)⊔○(∾⟜(≠chF))𝕩}○∾⟜(⥊¨∘⥊¨)´<˘⍉(2(÷˜∾⊣)≢)⊸⥊𝕩}
+MakeTab←{{⊑∘(∾⟜0)¨¯1↓(chF⊐𝕨)⊔○(∾⟜(≠chF))𝕩}○∾⟜(⥊¨∘⥊¨)˝⍉(2(÷˜∾⊣)≢)⊸⥊𝕩}
tab1←MakeTab⟨
"⊣⊢" , 2⥊<⟨⟩
"|-⌈⌊√" , (Hex"99")+(↕4)∾6
@@ -98,7 +98,7 @@ f64←127-3
GenFn←{
⟨⟩GenFn𝕩;
⟨t,r,nVar,nLoc,lits⟩←𝕨Tokenize𝕩
- t⊏˜↩⍋+`-´<˘(2‿3⊏bB)=⌜t
+ t⊏˜↩⍋+`-˝(2‿3⊏bB)=⌜t
nd←+´c←t=3⊑bB
t↩((vi+nVar+≠lits)+↕∘≠)⌾(c⊸/)t
⟨a,na⟩←Parse t
@@ -111,7 +111,7 @@ GenFn←{
}
Gen←{
- LEB←{0:⥊0;128⊸+⌾(¯1⊸↓) 2 Base˘ (⌽·∨`·⌽∨´˘)⊸/ 10‿7(⊣⥊×´⊸↑) 64 Enc2 𝕩}
+ LEB←{0:⥊0;128⊸+⌾(¯1⊸↓) 2 Base˘ (∨`⌾⌽∨˝˘)⊸/ 10‿7(⊣⥊×´⊸↑) 64 Enc2 𝕩}
C←LEB∘≠⊸∾
S←∾⟜C
V←≠∾∾
@@ -163,7 +163,7 @@ DParse ← {nv‿r𝕊𝕩:
prims←⟨
+,-,×,÷,⋆,√,⌊,⌈,|,¬,∧,∨,<,>,≠,=,≤,≥,≡,≢,⊣,⊢,⥊,∾,≍,↑,↓,↕,⌽,⍉,/,⍋,⍒,⊏,⊑,⊐,⊒,∊,⍷,⊔,!
- ˜,˘,¨,⌜,⁼,´,`
+ ˜,˘,¨,⌜,⁼,´,˝,`
∘,○,⊸,⟜,⌾,⊘,◶,⎉,⚇,⍟
DGenFn←{
diff --git a/doc/context.md b/doc/context.md
index fe800cfa..bf2183bb 100644
--- a/doc/context.md
+++ b/doc/context.md
@@ -38,7 +38,7 @@ BQN's expression grammar is a simplified version of the typical APL, removing so
| 1-modifier | Monadic operator | Adverb
| 2-modifier | Dyadic operator | Conjunction
-Unlike variables, BQN primitives have only one spelling, and a fixed role (but their values can be used in a different role by storing them in variables). Superscript glyphs `` ˜¨˘⁼⌜´` `` are used for 1-modifiers, and glyphs `∘○⊸⟜⌾⊘◶⚇⎉⍟` with an unbroken circle are 2-modifiers. Other primitives are functions. String and numeric literals are subjects.
+Unlike variables, BQN primitives have only one spelling, and a fixed role (but their values can be used in a different role by storing them in variables). Superscript glyphs `` ˜¨˘⁼⌜´˝` `` are used for 1-modifiers, and glyphs `∘○⊸⟜⌾⊘◶⚇⎉⍟` with an unbroken circle are 2-modifiers. Other primitives are functions. String and numeric literals are subjects.
BQN's variables use another system, where the spelling indicates how the variable's value is used. A variable spelled with a lowercase first letter, like `var`, is a subject. Spelled with an uppercase first letter, like `Var`, it is a function. Underscores are placed where operands apply to indicate a 1-modifier `_var` or 2-modifier `_var_`. Other than the first letter or underscore, variables are case-insensitive.
diff --git a/doc/fromDyalog.md b/doc/fromDyalog.md
index 3eaf752d..2f4e5aae 100644
--- a/doc/fromDyalog.md
+++ b/doc/fromDyalog.md
@@ -20,7 +20,7 @@ Here are some closest equivalents in Dyalog APL for the BQN functions that don't
Modifiers are a little harder. Many have equivalents in some cases, but Dyalog sometimes chooses different functionality based on whether the operand is an array. In BQN an array is always treated as a constant function.
-| BQN | `¨` | `⌜` | `´` | `⎉` | `⍟` | `˜` | `∘` | `○` | `⟜` |
+| BQN | `¨` | `⌜` | `˝` | `⎉` | `⍟` | `˜` | `∘` | `○` | `⟜` |
|--------|-----|------|-----|-----|-----|-----|-----|-----|-----|
| Dyalog | `¨` | `∘.` | `⌿` | `⍤` | `⍣` | `⍨` | `⍤` | `⍥` | `∘` |
@@ -62,19 +62,19 @@ The tables below give approximate implementations of Dyalog primitives for the o
<tr><td> <code>⍕</code> </td> </tr>
<tr><td> <code>⊥</code> </td><td> </td><td> <code>{+⟜(𝕨⊸×)´⌽𝕩}</code> </td> </tr>
<tr><td> <code>⊤</code> </td><td> </td><td> <code>{𝕨|1↓⌊∘÷`⌾⌽𝕨∾<𝕩}</code></td> </tr>
-<tr><td> <code>⌹</code> </td><td colspan=2><code>+´∘×⎉1‿∞⁼</code> I guess</td> </tr>
+<tr><td> <code>⌹</code> </td><td colspan=2><code>+˝∘×⎉1‿∞⁼</code> I guess</td> </tr>
<tr><td> <code>⌷</code> </td><td> N/A </td><td> <code>⊏</code></td> </tr>
</table>
<table>
<tr><th colspan=3>Operators</th></tr>
<tr><th> Syntax </th><th> Monadic </th><th> Dyadic </th></tr>
-<tr><td> <code>⌿</code> </td><td> <code>´</code> </td><td> <code>↕</code> </td></tr>
+<tr><td> <code>⌿</code> </td><td> <code>¨˝</code> </td><td> <code>↕</code> </td></tr>
<tr><td> <code>⍀</code> </td><td colspan=2> <code>↑</code> or <code>`</code> </td></tr>
<tr><td> <code>¨</code> </td><td colspan=2> <code>¨</code> </td></tr>
<tr><td> <code>⍨</code> </td><td colspan=2> <code>˜</code> </td></tr>
<tr><td> <code>⍣</code> </td><td colspan=2> <code>⍟</code> </td></tr>
-<tr><td> <code>f.g</code> </td><td> </td><td> <code>(f´<˘)∘g⎉1‿∞</code></td></tr>
+<tr><td> <code>f.g</code> </td><td> </td><td> <code>f˝∘g⎉1‿∞</code> </td></tr>
<tr><td> <code>∘.f</code> </td><td> </td><td> <code>f⌜</code> </td></tr>
<tr><td> <code>A∘g</code> </td><td> <code>A⊸g</code> </td><td> </td></tr>
<tr><td> <code>f∘B</code> </td><td> <code>f⟜B</code> </td><td> </td></tr>
diff --git a/doc/group.md b/doc/group.md
index dcf13220..e043e5ca 100644
--- a/doc/group.md
+++ b/doc/group.md
@@ -103,6 +103,6 @@ In other cases, we might want to split on spaces, so that words are separated by
However, trailing spaces are ignored because Group never produces trailing empty groups (to get them back we would use a dummy final character in the string). To avoid empty words, we should increase the word index only once per group of spaces. We can do this by taking the prefix sum of a list that is 1 only for a space with no space before it. To make such a list, we can use the [Windows](windows.md) function. We will extend our list with an initial 1 so that leading spaces will be ignored. Then we take windows of the same length as the original list: the first includes the dummy argument followed by a shifted copy of the list, and the second is the original list. These represent whether the previous and current characters are spaces; we want positions where the previous wasn't a space and the current is.
- ≍⟜((<´<˘)≠↕1∾⊢) ' '=" string with spaces " # All, then filtered, spaces
- ≍⟜(⊢-˜¬×+`∘((<´<˘)≠↕1∾⊢))' '=" string with spaces " # More processing
- ' '((⊢-˜¬×+`∘((<´<˘)≠↕1∾⊢))∘=⊔⊢)" string with spaces " # Final result
+ ≍⟜(<˝≠↕1∾⊢) ' '=" string with spaces " # All, then filtered, spaces
+ ≍⟜(⊢-˜¬×+`∘(<˝≠↕1∾⊢))' '=" string with spaces " # More processing
+ ' '((⊢-˜¬×+`∘(<˝≠↕1∾⊢))∘=⊔⊢)" string with spaces " # Final result
diff --git a/doc/transpose.md b/doc/transpose.md
index 3e7bf5c3..21628dcd 100644
--- a/doc/transpose.md
+++ b/doc/transpose.md
@@ -6,7 +6,7 @@ As in APL, Transpose (`⍉`) is a tool for rearranging the axes of an array. BQN
## Monadic Transpose
-Transposing a matrix exchanges its axes, mirroring it across the diagonal. APL extends the function to any rank by reversing all axes, but this generalization isn't very natural and is almost never used. The main reason for it is to maintain the equivalence `a MP b ←→ a MP⌾⍉ b`, where `MP ← (+´<˘)∘×⎉1‿∞` is the generalized matrix product. But even here APL's Transpose is suspect. It does much more work than it needs to, as we'll see.
+Transposing a matrix exchanges its axes, mirroring it across the diagonal. APL extends the function to any rank by reversing all axes, but this generalization isn't very natural and is almost never used. The main reason for it is to maintain the equivalence `a MP b ←→ a MP⌾⍉ b`, where `MP ← +˝∘×⎉1‿∞` is the generalized matrix product. But even here APL's Transpose is suspect. It does much more work than it needs to, as we'll see.
BQN's transpose takes the first axis of its argument and moves it to the end.
diff --git a/doc/windows.md b/doc/windows.md
index a60e1ae0..2f1eda55 100644
--- a/doc/windows.md
+++ b/doc/windows.md
@@ -68,8 +68,8 @@ Windows can be followed up with a reduction on each slice to give a windowed red
A common task is to pair elements, with an initial or final element so the total length stays the same. This can also be done with a pairwise reduction, but another good way (and more performant without special support in the interpreter) is to add the element and then use windows matching the original length. Here both methods are used to invert `` +` ``, which requires we take pairwise differences starting at initial value 0.
-˜´˘2↕0∾ +` 3‿2‿1‿1
- ((-˜´<˘)≠↕0∾⊢) +` 3‿2‿1‿1
+ (-˜˝≠↕0∾⊢) +` 3‿2‿1‿1
This method extends to any number of initial elements. We can modify the running sum above to keep the length constant by starting with two zeros.
- ((+´<˘)≠↕(2⥊0)⊸∾) ⟨2,6,0,1,4,3⟩
+ (+˝≠↕(2⥊0)⊸∾) ⟨2,6,0,1,4,3⟩
diff --git a/docs/doc/context.html b/docs/doc/context.html
index b4c5616f..8d108e5f 100644
--- a/docs/doc/context.html
+++ b/docs/doc/context.html
@@ -50,7 +50,7 @@
</tr>
</tbody>
</table>
-<p>Unlike variables, BQN primitives have only one spelling, and a fixed role (but their values can be used in a different role by storing them in variables). Superscript glyphs <code><span class='Modifier'>˜¨˘⁼⌜´`</span></code> are used for 1-modifiers, and glyphs <code><span class='Modifier2'>∘○⊸⟜⌾⊘◶⚇⎉⍟</span></code> with an unbroken circle are 2-modifiers. Other primitives are functions. String and numeric literals are subjects.</p>
+<p>Unlike variables, BQN primitives have only one spelling, and a fixed role (but their values can be used in a different role by storing them in variables). Superscript glyphs <code><span class='Modifier'>˜¨˘⁼⌜´˝`</span></code> are used for 1-modifiers, and glyphs <code><span class='Modifier2'>∘○⊸⟜⌾⊘◶⚇⎉⍟</span></code> with an unbroken circle are 2-modifiers. Other primitives are functions. String and numeric literals are subjects.</p>
<p>BQN's variables use another system, where the spelling indicates how the variable's value is used. A variable spelled with a lowercase first letter, like <code><span class='Value'>var</span></code>, is a subject. Spelled with an uppercase first letter, like <code><span class='Function'>Var</span></code>, it is a function. Underscores are placed where operands apply to indicate a 1-modifier <code><span class='Modifier'>_var</span></code> or 2-modifier <code><span class='Modifier2'>_var_</span></code>. Other than the first letter or underscore, variables are case-insensitive.</p>
<p>The associations between spelling and syntactic role are considered part of BQN's <a href="../spec/token.html">token formation rules</a>.</p>
<p>One rule for typing is also best considered to be a pre-parsing rule like the spelling system: the role of a brace construct <code><span class='Brace'>{}</span></code> with no header is determined by which special arguments it uses: it's a subject if there are none, but a <code><span class='Value'>𝕨</span></code> or <code><span class='Value'>𝕩</span></code> makes it at least a function, an <code><span class='Function'>𝔽</span></code> makes it a 1- or 2-modifier, and a <code><span class='Function'>𝔾</span></code> always makes it a 2-modifier.</p>
diff --git a/docs/doc/fromDyalog.html b/docs/doc/fromDyalog.html
index 0b9ca972..ec02f2e7 100644
--- a/docs/doc/fromDyalog.html
+++ b/docs/doc/fromDyalog.html
@@ -116,7 +116,7 @@
<th>BQN</th>
<th><code><span class='Modifier'>¨</span></code></th>
<th><code><span class='Modifier'>⌜</span></code></th>
-<th><code><span class='Modifier'>´</span></code></th>
+<th><code><span class='Modifier'>˝</span></code></th>
<th><code><span class='Modifier2'>⎉</span></code></th>
<th><code><span class='Modifier2'>⍟</span></code></th>
<th><code><span class='Modifier'>˜</span></code></th>
@@ -175,19 +175,19 @@
<tr><td> <code><span class='Value'>⍕</span></code> </td> </tr>
<tr><td> <code><span class='Value'>⊥</span></code> </td><td> </td><td> <code><span class='Brace'>{</span><span class='Function'>+</span><span class='Modifier2'>⟜</span><span class='Paren'>(</span><span class='Value'>𝕨</span><span class='Modifier2'>⊸</span><span class='Function'>×</span><span class='Paren'>)</span><span class='Modifier'>´</span><span class='Function'>⌽</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code> </td> </tr>
<tr><td> <code><span class='Value'>⊤</span></code> </td><td> </td><td> <code><span class='Brace'>{</span><span class='Value'>𝕨</span><span class='Function'>|</span><span class='Number'>1</span><span class='Function'>↓⌊</span><span class='Modifier2'>∘</span><span class='Function'>÷</span><span class='Modifier'>`</span><span class='Modifier2'>⌾</span><span class='Function'>⌽</span><span class='Value'>𝕨</span><span class='Function'>∾<</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code></td> </tr>
-<tr><td> <code><span class='Value'>⌹</span></code> </td><td colspan=2><code><span class='Function'>+</span><span class='Modifier'>´</span><span class='Modifier2'>∘</span><span class='Function'>×</span><span class='Modifier2'>⎉</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>∞</span><span class='Modifier'>⁼</span></code> I guess</td> </tr>
+<tr><td> <code><span class='Value'>⌹</span></code> </td><td colspan=2><code><span class='Function'>+</span><span class='Modifier'>˝</span><span class='Modifier2'>∘</span><span class='Function'>×</span><span class='Modifier2'>⎉</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>∞</span><span class='Modifier'>⁼</span></code> I guess</td> </tr>
<tr><td> <code><span class='Value'>⌷</span></code> </td><td> N/A </td><td> <code><span class='Function'>⊏</span></code></td> </tr>
</table>
<table>
<tr><th colspan=3>Operators</th></tr>
<tr><th> Syntax </th><th> Monadic </th><th> Dyadic </th></tr>
-<tr><td> <code><span class='Value'>⌿</span></code> </td><td> <code><span class='Modifier'>´</span></code> </td><td> <code><span class='Function'>↕</span></code> </td></tr>
+<tr><td> <code><span class='Value'>⌿</span></code> </td><td> <code><span class='Modifier'>˝</span></code> </td><td> <code><span class='Function'>↕</span></code> </td></tr>
<tr><td> <code><span class='Value'>⍀</span></code> </td><td colspan=2> <code><span class='Function'>↑</span></code> or <code><span class='Modifier'>`</span></code> </td></tr>
<tr><td> <code><span class='Modifier'>¨</span></code> </td><td colspan=2> <code><span class='Modifier'>¨</span></code> </td></tr>
<tr><td> <code><span class='Value'>⍨</span></code> </td><td colspan=2> <code><span class='Modifier'>˜</span></code> </td></tr>
<tr><td> <code><span class='Value'>⍣</span></code> </td><td colspan=2> <code><span class='Modifier2'>⍟</span></code> </td></tr>
-<tr><td> <code><span class='Value'>f.g</span></code> </td><td> </td><td> <code><span class='Paren'>(</span><span class='Value'>f</span><span class='Modifier'>´</span><span class='Function'><</span><span class='Modifier'>˘</span><span class='Paren'>)</span><span class='Modifier2'>∘</span><span class='Value'>g</span><span class='Modifier2'>⎉</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>∞</span></code></td></tr>
+<tr><td> <code><span class='Value'>f.g</span></code> </td><td> </td><td> <code><span class='Value'>f</span><span class='Modifier'>˝</span><span class='Modifier2'>∘</span><span class='Value'>g</span><span class='Modifier2'>⎉</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>∞</span></code> </td></tr>
<tr><td> <code><span class='Modifier2'>∘</span><span class='Number'>.f</span></code> </td><td> </td><td> <code><span class='Value'>f</span><span class='Modifier'>⌜</span></code> </td></tr>
<tr><td> <code><span class='Function'>A</span><span class='Modifier2'>∘</span><span class='Value'>g</span></code> </td><td> <code><span class='Function'>A</span><span class='Modifier2'>⊸</span><span class='Value'>g</span></code> </td><td> </td></tr>
<tr><td> <code><span class='Value'>f</span><span class='Modifier2'>∘</span><span class='Function'>B</span></code> </td><td> <code><span class='Value'>f</span><span class='Modifier2'>⟜</span><span class='Function'>B</span></code> </td><td> </td></tr>
diff --git a/docs/doc/group.html b/docs/doc/group.html
index 590b166b..2ec68f63 100644
--- a/docs/doc/group.html
+++ b/docs/doc/group.html
@@ -138,17 +138,17 @@
⟨ ⟨⟩ ⟨⟩ "string" "with" ⟨⟩ "spaces" ⟩
</pre>
<p>However, trailing spaces are ignored because Group never produces trailing empty groups (to get them back we would use a dummy final character in the string). To avoid empty words, we should increase the word index only once per group of spaces. We can do this by taking the prefix sum of a list that is 1 only for a space with no space before it. To make such a list, we can use the <a href="windows.html">Windows</a> function. We will extend our list with an initial 1 so that leading spaces will be ignored. Then we take windows of the same length as the original list: the first includes the dummy argument followed by a shifted copy of the list, and the second is the original list. These represent whether the previous and current characters are spaces; we want positions where the previous wasn't a space and the current is.</p>
-<pre> <span class='Function'>≍</span><span class='Modifier2'>⟜</span><span class='Paren'>((</span><span class='Function'>&lt;</span><span class='Modifier'>´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span><span class='Paren'>)</span><span class='Function'>≠↕</span><span class='Number'>1</span><span class='Function'>∾⊢</span><span class='Paren'>)</span> <span class='String'>' '</span><span class='Function'>=</span><span class='String'>&quot; string with spaces &quot;</span> <span class='Comment'># All, then filtered, spaces
+<pre> <span class='Function'>≍</span><span class='Modifier2'>⟜</span><span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˝</span><span class='Function'>≠↕</span><span class='Number'>1</span><span class='Function'>∾⊢</span><span class='Paren'>)</span> <span class='String'>' '</span><span class='Function'>=</span><span class='String'>&quot; string with spaces &quot;</span> <span class='Comment'># All, then filtered, spaces
</span>┌─
╵ 1 1 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0
- <span class='Function'>≍</span><span class='Modifier2'>⟜</span><span class='Paren'>(</span><span class='Function'>⊢-</span><span class='Modifier'>˜</span><span class='Function'>¬×+</span><span class='Modifier'>`</span><span class='Modifier2'>∘</span><span class='Paren'>((</span><span class='Function'>&lt;</span><span class='Modifier'>´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span><span class='Paren'>)</span><span class='Function'>≠↕</span><span class='Number'>1</span><span class='Function'>∾⊢</span><span class='Paren'>))</span><span class='String'>' '</span><span class='Function'>=</span><span class='String'>&quot; string with spaces &quot;</span> <span class='Comment'># More processing
+ <span class='Function'>≍</span><span class='Modifier2'>⟜</span><span class='Paren'>(</span><span class='Function'>⊢-</span><span class='Modifier'>˜</span><span class='Function'>¬×+</span><span class='Modifier'>`</span><span class='Modifier2'>∘</span><span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˝</span><span class='Function'>≠↕</span><span class='Number'>1</span><span class='Function'>∾⊢</span><span class='Paren'>))</span><span class='String'>' '</span><span class='Function'>=</span><span class='String'>&quot; string with spaces &quot;</span> <span class='Comment'># More processing
</span>┌─
╵ 1 1 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1
¯1 ¯1 0 0 0 0 0 0 ¯1 1 1 1 1 ¯1 ¯1 2 2 2 2 2 2 ¯1 ¯1 ¯1
- <span class='String'>' '</span><span class='Paren'>((</span><span class='Function'>⊢-</span><span class='Modifier'>˜</span><span class='Function'>¬×+</span><span class='Modifier'>`</span><span class='Modifier2'>∘</span><span class='Paren'>((</span><span class='Function'>&lt;</span><span class='Modifier'>´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span><span class='Paren'>)</span><span class='Function'>≠↕</span><span class='Number'>1</span><span class='Function'>∾⊢</span><span class='Paren'>))</span><span class='Modifier2'>∘</span><span class='Function'>=⊔⊢</span><span class='Paren'>)</span><span class='String'>&quot; string with spaces &quot;</span> <span class='Comment'># Final result
+ <span class='String'>' '</span><span class='Paren'>((</span><span class='Function'>⊢-</span><span class='Modifier'>˜</span><span class='Function'>¬×+</span><span class='Modifier'>`</span><span class='Modifier2'>∘</span><span class='Paren'>(</span><span class='Function'>&lt;</span><span class='Modifier'>˝</span><span class='Function'>≠↕</span><span class='Number'>1</span><span class='Function'>∾⊢</span><span class='Paren'>))</span><span class='Modifier2'>∘</span><span class='Function'>=⊔⊢</span><span class='Paren'>)</span><span class='String'>&quot; string with spaces &quot;</span> <span class='Comment'># Final result
</span>⟨ "string" "with" "spaces" ⟩
</pre>
diff --git a/docs/doc/transpose.html b/docs/doc/transpose.html
index 3b5af23b..93e5da73 100644
--- a/docs/doc/transpose.html
+++ b/docs/doc/transpose.html
@@ -3,7 +3,7 @@
<h1 id="transpose">Transpose</h1>
<p>As in APL, Transpose (<code><span class='Function'>⍉</span></code>) is a tool for rearranging the axes of an array. BQN's version is tweaked to align better with the leading axis model and make common operations easier.</p>
<h2 id="monadic-transpose">Monadic Transpose</h2>
-<p>Transposing a matrix exchanges its axes, mirroring it across the diagonal. APL extends the function to any rank by reversing all axes, but this generalization isn't very natural and is almost never used. The main reason for it is to maintain the equivalence <code><span class='Value'>a</span> <span class='Function'>MP</span> <span class='Value'>b</span> <span class='Gets'>←→</span> <span class='Value'>a</span> <span class='Function'>MP</span><span class='Modifier2'>⌾</span><span class='Function'>⍉</span> <span class='Value'>b</span></code>, where <code><span class='Function'>MP</span> <span class='Gets'>←</span> <span class='Paren'>(</span><span class='Function'>+</span><span class='Modifier'>´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span><span class='Paren'>)</span><span class='Modifier2'>∘</span><span class='Function'>×</span><span class='Modifier2'>⎉</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>∞</span></code> is the generalized matrix product. But even here APL's Transpose is suspect. It does much more work than it needs to, as we'll see.</p>
+<p>Transposing a matrix exchanges its axes, mirroring it across the diagonal. APL extends the function to any rank by reversing all axes, but this generalization isn't very natural and is almost never used. The main reason for it is to maintain the equivalence <code><span class='Value'>a</span> <span class='Function'>MP</span> <span class='Value'>b</span> <span class='Gets'>←→</span> <span class='Value'>a</span> <span class='Function'>MP</span><span class='Modifier2'>⌾</span><span class='Function'>⍉</span> <span class='Value'>b</span></code>, where <code><span class='Function'>MP</span> <span class='Gets'>←</span> <span class='Function'>+</span><span class='Modifier'>˝</span><span class='Modifier2'>∘</span><span class='Function'>×</span><span class='Modifier2'>⎉</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>∞</span></code> is the generalized matrix product. But even here APL's Transpose is suspect. It does much more work than it needs to, as we'll see.</p>
<p>BQN's transpose takes the first axis of its argument and moves it to the end.</p>
<pre> <span class='Function'>≢</span> <span class='Value'>a23456</span> <span class='Gets'>←</span> <span class='Function'>↕</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>5</span><span class='Ligature'>‿</span><span class='Number'>6</span>
<span class='Bracket'>⟨</span> <span class='Number'>2</span> <span class='Number'>3</span> <span class='Number'>4</span> <span class='Number'>5</span> <span class='Number'>6</span> <span class='Bracket'>⟩</span>
diff --git a/docs/doc/windows.html b/docs/doc/windows.html
index c20d6591..113d5ffd 100644
--- a/docs/doc/windows.html
+++ b/docs/doc/windows.html
@@ -81,11 +81,11 @@
<p>A common task is to pair elements, with an initial or final element so the total length stays the same. This can also be done with a pairwise reduction, but another good way (and more performant without special support in the interpreter) is to add the element and then use windows matching the original length. Here both methods are used to invert <code><span class='Function'>+</span><span class='Modifier'>`</span></code>, which requires we take pairwise differences starting at initial value 0.</p>
<pre> <span class='Function'>-</span><span class='Modifier'>˜´˘</span><span class='Number'>2</span><span class='Function'>↕</span><span class='Number'>0</span><span class='Function'>∾</span> <span class='Function'>+</span><span class='Modifier'>`</span> <span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>1</span>
⟨ 3 2 1 1 ⟩
- <span class='Paren'>((</span><span class='Function'>-</span><span class='Modifier'>˜´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span><span class='Paren'>)</span><span class='Function'>≠↕</span><span class='Number'>0</span><span class='Function'>∾⊢</span><span class='Paren'>)</span> <span class='Function'>+</span><span class='Modifier'>`</span> <span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>1</span>
+ <span class='Paren'>(</span><span class='Function'>-</span><span class='Modifier'>˜˝</span><span class='Function'>≠↕</span><span class='Number'>0</span><span class='Function'>∾⊢</span><span class='Paren'>)</span> <span class='Function'>+</span><span class='Modifier'>`</span> <span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>1</span>
⟨ 3 2 1 1 ⟩
</pre>
<p>This method extends to any number of initial elements. We can modify the running sum above to keep the length constant by starting with two zeros.</p>
-<pre> <span class='Paren'>((</span><span class='Function'>+</span><span class='Modifier'>´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span><span class='Paren'>)</span><span class='Function'>≠↕</span><span class='Paren'>(</span><span class='Number'>2</span><span class='Function'>⥊</span><span class='Number'>0</span><span class='Paren'>)</span><span class='Modifier2'>⊸</span><span class='Function'>∾</span><span class='Paren'>)</span> <span class='Bracket'>⟨</span><span class='Number'>2</span><span class='Separator'>,</span><span class='Number'>6</span><span class='Separator'>,</span><span class='Number'>0</span><span class='Separator'>,</span><span class='Number'>1</span><span class='Separator'>,</span><span class='Number'>4</span><span class='Separator'>,</span><span class='Number'>3</span><span class='Bracket'>⟩</span>
+<pre> <span class='Paren'>(</span><span class='Function'>+</span><span class='Modifier'>˝</span><span class='Function'>≠↕</span><span class='Paren'>(</span><span class='Number'>2</span><span class='Function'>⥊</span><span class='Number'>0</span><span class='Paren'>)</span><span class='Modifier2'>⊸</span><span class='Function'>∾</span><span class='Paren'>)</span> <span class='Bracket'>⟨</span><span class='Number'>2</span><span class='Separator'>,</span><span class='Number'>6</span><span class='Separator'>,</span><span class='Number'>0</span><span class='Separator'>,</span><span class='Number'>1</span><span class='Separator'>,</span><span class='Number'>4</span><span class='Separator'>,</span><span class='Number'>3</span><span class='Bracket'>⟩</span>
⟨ 2 8 8 7 5 8 ⟩
</pre>
diff --git a/docs/index.html b/docs/index.html
index 57e708ba..711e419e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -434,6 +434,12 @@
<td></td>
</tr>
<tr>
+<td><code><span class='Modifier'>˝</span></code></td>
+<td>Insert</td>
+<td></td>
+<td></td>
+</tr>
+<tr>
<td><code><span class='Modifier'>`</span></code></td>
<td>Scan</td>
<td></td>
diff --git a/docs/problems.html b/docs/problems.html
index 252cdb1c..595ed18d 100644
--- a/docs/problems.html
+++ b/docs/problems.html
@@ -20,14 +20,6 @@
<p>There are a lot of standard functions and I don't want to use separate primitives or a menu-style primitive like APL Circle for them. You can define all the functions eventually if you use complex exponential and take real and imaginary parts and inverses, but this doesn't sound well-suited for implementation. And there should be a math library that gives you the standard functions with normal names, but how will it be implemented?</p>
<h3 id="right-to-left-multi-line-functions-go-upwards">Right-to-left multi-line functions go upwards</h3>
<p>If you include multiple multi-line functions in what would otherwise be a one-liner, the flow in each function goes top to bottom but the functions are executed bottom to top. I think the fix here is to just say give your functions names and don't do this.</p>
-<h3 id="array-reductions-are-annoying">Array reductions are annoying</h3>
-<p>There are really three kinds of reduction a BQN programmer might want to use.</p>
-<ul>
-<li><code><span class='Function'>𝔽</span><span class='Modifier'>´</span></code> Apply the function between elements of a list (Lisp).</li>
-<li><code><span class='Function'>𝔽</span><span class='Modifier'>´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span></code> Apply it between major cells of an array (SHARP).</li>
-<li><code><span class='Function'>𝔽</span><span class='Modifier'>¨´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span></code> Apply it between elements of an array, enclosing results to get a new array (NARS).</li>
-</ul>
-<p>It seems that the first is the most common, but the others aren't really rare. The current list reduction also encourages patterns like <code><span class='Function'>+</span><span class='Modifier'>´˘</span><span class='Number'>2</span><span class='Function'>↕</span><span class='Value'>mat</span></code>, which don't work on higher-rank arrays and mix the result (possibly unwanted).</p>
<h3 id="subtraction-division-and-span-are-backwards">Subtraction, division, and span are backwards</h3>
<p>The left argument feels much more like the primary one in these cases (indeed, this matches the typical left-to-right ordering of binary operators in mathematics). Not really fixable; too much precedent.</p>
<h3 id="cant-access-array-ordering-directly">Can't access array ordering directly</h3>
@@ -104,6 +96,14 @@
<p>I went with &quot;Index of&quot; and &quot;Less Than or Equal to&quot; but the last word blends into surrounding text. Should they be fully capitalized or hyphenated?</p>
<h2 id="solved-problems">Solved problems</h2>
<p>Problems that existed in mainstream APL or a transitional BQN that have in my opinion been put to rest (while in some cases introducing new problems). Listed in reverse chronological order by time solved, by my recollection.</p>
+<h3 id="array-reductions-are-annoying">Array reductions are annoying</h3>
+<p>There are really three kinds of reduction a BQN programmer might want to use.</p>
+<ul>
+<li><code><span class='Function'>𝔽</span><span class='Modifier'>´</span></code> Apply the function between elements of a list (Lisp).</li>
+<li><code><span class='Function'>𝔽</span><span class='Modifier'>˝</span></code> Apply it between major cells of an array (SHARP).</li>
+<li><code><span class='Function'>𝔽</span><span class='Modifier'>¨˝</span></code> Apply it between elements of an array, enclosing results to get a new array (NARS).</li>
+</ul>
+<p>BQN bounced between these some at first; eventually I decided it really needed two, with <code><span class='Function'>𝔽</span><span class='Modifier'>˝</span></code> equivalent to <code><span class='Function'>𝔽</span><span class='Modifier'>´</span><span class='Function'>&lt;</span><span class='Modifier'>˘</span></code>. The last requires two symbols, but they can always be used together as a unit, so I think this is no longer annoying.</p>
<h3 id="modifier-and-composition-terminology">&quot;Modifier&quot; and &quot;composition&quot; terminology</h3>
<p>1-modifiers and 2-modifiers used to be called &quot;modifiers&quot; and &quot;compositions&quot;, respectively, and sometimes &quot;operators&quot; collectively. The new names are much better, although they do leave a disconnect between the names for modifiers, and those for their inputs—&quot;operands&quot;.</p>
<h3 id="cant-return-from-inner-functions">Can't return from inner functions</h3>
diff --git a/docs/spec/token.html b/docs/spec/token.html
index c12fc3e4..3fcfbe6d 100644
--- a/docs/spec/token.html
+++ b/docs/spec/token.html
@@ -22,7 +22,7 @@
</tr>
<tr>
<td>Primitive 1-Modifier</td>
-<td><code><span class='Modifier'>˜˘¨⌜⁼´`</span></code></td>
+<td><code><span class='Modifier'>˜˘¨⌜⁼´˝`</span></code></td>
</tr>
<tr>
<td>Primitive 1-Modifier</td>
diff --git a/dzref b/dzref
index 4ce64b25..c4c56596 100755
--- a/dzref
+++ b/dzref
@@ -24,7 +24,12 @@ _depthOp_←{
}
𝕨 n _d 𝕩
}
+_insert←{
+ ! 1≤=𝕩
+ 𝕨 𝔽´ <˘𝕩
+}
⚇ ← _depthOp_
+˝ ← _insert
#⌜
@@ -82,7 +87,7 @@ Join←{
IndexOf←(1<⌈○=)◶⊐‿{
c←1-˜=𝕨
! 0≤c
- 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,((+´<˘)∧`)≢⎉c⎉c‿∞⟩ 𝕩
+ 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,(+˝∧`)≢⎉c⎉c‿∞⟩ 𝕩
}
UniqueMask←{
! 1≤=𝕩
@@ -132,8 +137,8 @@ _bins←{
c←1-˜=𝕨
! 0≤c
LE←𝔽⎉c≤0˜
- ! (0<≠)◶⟨1,∧´·LE´˘2↕<˘⟩𝕨
- 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,(+´<˘)LE⎉¯1‿∞⟩ 𝕩
+ ! (0<≠)◶⟨1,∧´·LE˝˘2↕⊢⟩𝕨
+ 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,+˝LE⎉¯1‿∞⟩ 𝕩
}
OccurrenceCount ← ⊐˜(⊢-⊏)⍋∘⍋
@@ -148,7 +153,7 @@ X←Raw←{≤4}
{
chrs←⟨
"!=∾↕⌽⍉⍋⍒⊐⊒∊⍷"
- ""
+ "˝"
"⚇"
nc ← ≠¨chrs
diff --git a/examples/fifty.bqn b/examples/fifty.bqn
index 593f9e12..ad80a4b2 100644
--- a/examples/fifty.bqn
+++ b/examples/fifty.bqn
@@ -64,14 +64,14 @@ NewtonsMethod ← (2 ÷˜ ⊢ + ÷)´¨∘(1↓↑) ⥊
! 1e¯5 > | (7 NewtonsMethod 2) - 2‿1.5‿1.41667‿1.41422‿1.41421‿1.41421‿1.41421
# 11
-InnerProduct ← (+´<˘)∘(ר)⎉1‿2
+InnerProduct ← +˝∘(ר)⎉1‿2
! (>⟨2‿3⋄4‿1⟩) ≡ (>⟨1‿0⋄¯1‿1⟩) InnerProduct >⟨2‿3⋄6‿4⟩
# 12
CayleysTheorem ← {R←∾⊐⊢ ⋄ (R𝕩) ≡ R ⊏˜⌜˜ <˘R𝕩}
! {
t ← 2‿2⊸⥊¨ (⌽2|⌊∘÷⟜2⍟(↕4))¨ 9‿6‿7‿11‿13‿14
- g ← (≠´<˘)∘(∧¨)⎉1‿2⌜˜t
+ g ← ≠˝∘(∧¨)⎉1‿2⌜˜t
CayleysTheorem g
}
@@ -81,7 +81,7 @@ IntervalIndex ← 1-˜≠∘⊣(⊣↓⊢⍋⊸⊏+`∘>)⍋∘∾ # Or ⍋, of
! 0‿1‿0‿¯1‿4‿4 ≡ "Fi Jay John Morten Roger" IntervalIndex○Words "JD Jd Geoff Anna Scott Zeus"
# 15
-CentralLimit ← { 41 ↑ /⁼ (5×↕40) ⍋ +´<˘ •Rand 𝕩⥊21 }
+CentralLimit ← { 41 ↑ /⁼ (5×↕40) ⍋ +˝ •Rand 𝕩⥊21 }
# 5‿8 ⥊ CentralLimit 10 1e3
# 17
diff --git a/md.bqn b/md.bqn
index b55ad4f7..1fd0861a 100644
--- a/md.bqn
+++ b/md.bqn
@@ -262,7 +262,7 @@ Markdown ← {filename𝕊𝕩:
codeMask ← ≠` I2M ⥊ codeBounds ← 1‿2⊸⊏˘ ctInds
𝕩 ↩ ' '¨⌾((codeMask∧𝕩=lf)⊸/) 𝕩
# If span has both a leading and a trailing space, they are removed.
- remSpace ← I2M ⥊ ((1<-˜´˘)∧·∧´˘' '=⊏⟜𝕩)⊸/ -⟜0‿1˘ codeBounds
+ remSpace ← I2M ⥊ ((1<-˜˝˘)∧·∧˝˘' '=⊏⟜𝕩)⊸/ -⟜0‿1˘ codeBounds
codeMask ∧↩ ¬ remSpace
⟨code,codePos⟩ ← codeMask extensions◶(2⥊<⟨⟩)‿GetMultiHighlights 𝕩
include ← ¬ remSpace ∨ ≠` I2M ⥊ ctInds
@@ -404,7 +404,7 @@ GetHighlights ← {
0 , " "∾•UCS 9‿10
"Value" , ¯1⊏˘5‿2⥊"𝕨𝕩𝕗𝕘𝕤"
"Function" , "+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!"∾¯1⊏˘5‿2⥊"𝕎𝕏𝔽𝔾𝕊"
- "Modifier" , "˜˘¨⌜⁼´`"
+ "Modifier" , "˜˘¨⌜⁼´˝`"
"Modifier2" , "∘○⊸⟜⌾⊘◶⎉⚇⍟"
"Number" , ∾idChars
"Gets" , "←↩→"
@@ -463,7 +463,7 @@ Fmt ← {
(𝕨/" ") (∾⎉1∾⎉1⊣) 𝕩
}
Pad ← PadH⟜PadV
- Enframe ← {(1≠𝕨)∨(1≠≠𝕩)∨⊑2∊+`-´<˘"⟨⟩"=⌜⊏𝕩}◶{
+ Enframe ← {(1≠𝕨)∨(1≠≠𝕩)∨⊑2∊+`-˝"⟨⟩"=⌜⊏𝕩}◶{
≍"⟨"∾(¯1↓1↓⊏𝕩)∾"⟩"
}‿{
l ← ¯1 ⊑ ≢𝕩
@@ -480,8 +480,8 @@ Fmt ← {
})
PaddingJoin ← {1𝕊𝕩;
s ← ≢¨ 𝕩
- w ← ⌈´⥊<⎉1 1⊑¨s
- h ← ⌈´⎉1 ⊑¨s
+ w ← ⌈˝⍟(=-1˜)1⊑¨s
+ h ← ⌈˝⎉1 ⊑¨s
∾⎉2 ≍⍟(0⌈2-=) (h ∾⌜ 𝕨×w¬(-𝕨×≠w)↑1) ↑¨ 𝕩
}
FmtMixed ← {
diff --git a/problems.md b/problems.md
index d9a68c88..c63af039 100644
--- a/problems.md
+++ b/problems.md
@@ -32,14 +32,6 @@ There are a lot of standard functions and I don't want to use separate primitive
### Right-to-left multi-line functions go upwards
If you include multiple multi-line functions in what would otherwise be a one-liner, the flow in each function goes top to bottom but the functions are executed bottom to top. I think the fix here is to just say give your functions names and don't do this.
-### Array reductions are annoying
-There are really three kinds of reduction a BQN programmer might want to use.
-- `𝔽´` Apply the function between elements of a list (Lisp).
-- `𝔽´<˘` Apply it between major cells of an array (SHARP).
-- `𝔽¨´<˘` Apply it between elements of an array, enclosing results to get a new array (NARS).
-
-It seems that the first is the most common, but the others aren't really rare. The current list reduction also encourages patterns like `+´˘2↕mat`, which don't work on higher-rank arrays and mix the result (possibly unwanted).
-
### Subtraction, division, and span are backwards
The left argument feels much more like the primary one in these cases (indeed, this matches the typical left-to-right ordering of binary operators in mathematics). Not really fixable; too much precedent.
@@ -136,6 +128,14 @@ I went with "Index of" and "Less Than or Equal to" but the last word blends into
Problems that existed in mainstream APL or a transitional BQN that have in my opinion been put to rest (while in some cases introducing new problems). Listed in reverse chronological order by time solved, by my recollection.
+### Array reductions are annoying
+There are really three kinds of reduction a BQN programmer might want to use.
+- `𝔽´` Apply the function between elements of a list (Lisp).
+- `𝔽˝` Apply it between major cells of an array (SHARP).
+- `𝔽¨˝` Apply it between elements of an array, enclosing results to get a new array (NARS).
+
+BQN bounced between these some at first; eventually I decided it really needed two, with `𝔽˝` equivalent to `𝔽´<˘`. The last requires two symbols, but they can always be used together as a unit, so I think this is no longer annoying.
+
### "Modifier" and "composition" terminology
1-modifiers and 2-modifiers used to be called "modifiers" and "compositions", respectively, and sometimes "operators" collectively. The new names are much better, although they do leave a disconnect between the names for modifiers, and those for their inputs—"operands".
diff --git a/spec/reference.bqn b/spec/reference.bqn
index 5d5424d8..1d0a5cca 100644
--- a/spec/reference.bqn
+++ b/spec/reference.bqn
@@ -182,6 +182,7 @@ Depth←IsArray◶0‿{1+0⌈´Depth¨⥊𝕩}
⚇ ← _depthOp_
⍟ ← _iterate_
˘ ← ⎉¯1
+˝ ← _insert
` ← _scan
DropV← {⊑⟜𝕩¨𝕨+↕𝕨-˜≠𝕩}
@@ -211,6 +212,10 @@ _rankOp_←{
}
> ((⊑k)Enc𝕨) 𝔽¨ ((1-˜≠)⊸⊑k)Enc𝕩
}
+_insert←{
+ ! 1≤=𝕩
+ 𝕨 𝔽´ <˘𝕩
+}
_scan←{
! IsArray 𝕩
! 1≤=𝕩
@@ -354,7 +359,7 @@ Group←{
IndexOf←{
c←1-˜=𝕨
! 0≤c
- 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,((+´<˘)∧`)≢⎉c⎉c‿∞⟩ 𝕩
+ 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,(+´˝∧`)≢⎉c⎉c‿∞⟩ 𝕩
}
UniqueMask←{
! 1≤=𝕩
@@ -403,8 +408,8 @@ _bins←{
c←1-˜=𝕨
! 0≤c
LE←𝔽⎉c≤0˜
- ! (0<≠)◶⟨1,∧´·LE´˘2↕<˘⟩𝕨
- 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,(+´<˘)LE⎉¯1‿∞⟩ 𝕩
+ ! (0<≠)◶⟨1,∧´·LE˝˘2↕⊢⟩𝕨
+ 𝕨 (0<≠𝕨)◶⟨0⎉c∘⊢,+´˝LE⎉¯1‿∞⟩ 𝕩
}
OccurrenceCount ← ⊐˜(⊢-⊏)⍋∘⍋
diff --git a/spec/token.md b/spec/token.md
index 0cf05d0d..603abfa7 100644
--- a/spec/token.md
+++ b/spec/token.md
@@ -19,7 +19,7 @@ Otherwise, a single character forms a token. Only the specified set of character
| Class | Characters
|-----------------------|------------
| Primitive Function | `+-×÷⋆√⌊⌈\|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔`
-| Primitive 1-Modifier | `` ˜˘¨⌜⁼´` ``
+| Primitive 1-Modifier | `` ˜˘¨⌜⁼´˝` ``
| Primitive 1-Modifier | `∘○⊸⟜⌾⊘◶⎉⚇⍟`
| Special name | `𝕨𝕩𝕗𝕘𝕤𝕎𝕏𝔽𝔾𝕊`
| Punctuation | `←↩→(){}⟨⟩‿⋄,` and newline