aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-02-28 21:59:14 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-02-28 21:59:14 -0500
commit3f2943af2a60afca1235f6b41fde8ea8abf1ae72 (patch)
treec4cbedeecb36b323166c02059b242b83415c5870
parent2ba9b33125c303368e08a29cc460c9f4d818441d (diff)
Split up cases of J / since ˝ only matches the monadic one
-rw-r--r--doc/fromJ.md15
-rw-r--r--docs/doc/fromJ.html20
2 files changed, 24 insertions, 11 deletions
diff --git a/doc/fromJ.md b/doc/fromJ.md
index e549533a..99d75821 100644
--- a/doc/fromJ.md
+++ b/doc/fromJ.md
@@ -78,7 +78,7 @@ Most of BQN's combinators have J equivalents. The J equivalent `"_` for `˙` ass
|:---:|:----:|:---:|:----:|:----:|:-----:|:---:|:----:|:----:|
| J | `"_` | `~` | `@:` | `&:` | `&.:` | `:` | `@.` | `::` |
-For other modifiers the correspondence is looser. Here `⌜` shows the dyadic case and `´` the monadic case only.
+For other modifiers the correspondence is looser. Here `⌜` shows the dyadic case and `´` `˝` the monadic case only.
| BQN | `¨` | `⌜` | `´` | `˝` | `` ` `` | `˘` | `⎉` | `⚇` | `⍟` | `⁼` |
|:---:|:-----:|:------:|:------:|:---:|:-------:|:-----:|:---:|:----:|:----:|:------:|
@@ -101,9 +101,9 @@ Some other primitives are essentially the same in J and BQN, but with different
|:---:|:---:|:---:|:---:|:----:|:----:|:----:|:----:|:---:|:---:|:-----:|:-----:|
| BQN | `×` | `÷` | `⋆` | `⋆⁼` | `√` | `⌊` | `⌈` | `⊣` | `⊢` | `⌽` | `⍉` |
-| J | `~` | `@:` | `&:` | `&.:` | `:` | `/` | `"` | `L:` | `^:` |
-|:---:|:---:|:----:|:----:|:-----:|:---:|:---:|:---:|:----:|:----:|
-| BQN | `˜` | `∘` | `○` | `⌾` | `⊘` | `˝` | `⎉` | `⚇` | `⍟` |
+| J | `~` | `@:` | `&:` | `&.:` | `:` | `"` | `L:` | `^:` |
+|:---:|:---:|:----:|:----:|:-----:|:---:|:---:|:----:|:----:|
+| BQN | `˜` | `∘` | `○` | `⌾` | `⊘` | `⎉` | `⚇` | `⍟` |
The tables below give approximate implementations of J primitives. J has a whole lot of complicated primitives that no one uses (some of which are officially deprecated), so not everything is translated here. Operations that only apply to complex numbers are omitted because no BQN implementation currently supports them.
@@ -150,10 +150,13 @@ Some J modifier expressions are translated below. BQN doesn't keep track of the
| J | BQN
|----------------|-----
| `&.>` | `¨`
+| `F/ y` | `F˝ y`
+| `x F&.>/ y` | `x F⌜ y`
+| `x F/ y` | `x F⎉r‿∞ y` where `r` is `F`'s left rank
| ``F`G`H@.C`` | `C◶⟨F,G,H⟩`
| `x y} z` | `x⌾(y⊸⊏) z`
-| `x F/ .G y` | `x F˝∘G⎉1‿∞ y`
-| `F:.G` | `{𝕊: 𝕨F𝕩; 𝕊⁼: 𝕨G𝕩}`
+| `x F/ . G y` | `x F˝∘G⎉1‿∞ y`
+| `F :. G` | `{𝕊: 𝕨F𝕩; 𝕊⁼: 𝕨G𝕩}`
| `<;._1` | ``((1-˜¬×+`)=⟜⊏⊘⊣)⊔⊢``
| `x {.!.f y` | `y » x⥊f`
| `x \|.!.f y` | `x ⥊⟜f⊸« y`, or `(-x) ⥊⟜f⊸» y` if `𝕩<0`
diff --git a/docs/doc/fromJ.html b/docs/doc/fromJ.html
index a74ef8bf..02fc397c 100644
--- a/docs/doc/fromJ.html
+++ b/docs/doc/fromJ.html
@@ -296,7 +296,7 @@
</tr>
</tbody>
</table>
-<p>For other modifiers the correspondence is looser. Here <code><span class='Modifier'>⌜</span></code> shows the dyadic case and <code><span class='Modifier'>´</span></code> the monadic case only.</p>
+<p>For other modifiers the correspondence is looser. Here <code><span class='Modifier'>⌜</span></code> shows the dyadic case and <code><span class='Modifier'>´</span></code> <code><span class='Modifier'>˝</span></code> the monadic case only.</p>
<table>
<thead>
<tr>
@@ -394,7 +394,6 @@
<th align="center"><code><span class='Value'>&amp;:</span></code></th>
<th align="center"><code><span class='Value'>&amp;</span><span class='Number'>.</span><span class='Value'>:</span></code></th>
<th align="center"><code><span class='Value'>:</span></code></th>
-<th align="center"><code><span class='Function'>/</span></code></th>
<th align="center"><code><span class='String'>&quot;</span></code></th>
<th align="center"><code><span class='Function'>L</span><span class='Value'>:</span></code></th>
<th align="center"><code><span class='Value'>^:</span></code></th>
@@ -408,7 +407,6 @@
<td align="center"><code><span class='Modifier2'>○</span></code></td>
<td align="center"><code><span class='Modifier2'>⌾</span></code></td>
<td align="center"><code><span class='Modifier2'>⊘</span></code></td>
-<td align="center"><code><span class='Modifier'>˝</span></code></td>
<td align="center"><code><span class='Modifier2'>⎉</span></code></td>
<td align="center"><code><span class='Modifier2'>⚇</span></code></td>
<td align="center"><code><span class='Modifier2'>⍟</span></code></td>
@@ -616,6 +614,18 @@
<td><code><span class='Modifier'>¨</span></code></td>
</tr>
<tr>
+<td><code><span class='Function'>F/</span> <span class='Value'>y</span></code></td>
+<td><code><span class='Function'>F</span><span class='Modifier'>˝</span> <span class='Value'>y</span></code></td>
+</tr>
+<tr>
+<td><code><span class='Value'>x</span> <span class='Function'>F</span><span class='Value'>&amp;</span><span class='Number'>.</span><span class='Function'>&gt;/</span> <span class='Value'>y</span></code></td>
+<td><code><span class='Value'>x</span> <span class='Function'>F</span><span class='Modifier'>⌜</span> <span class='Value'>y</span></code></td>
+</tr>
+<tr>
+<td><code><span class='Value'>x</span> <span class='Function'>F/</span> <span class='Value'>y</span></code></td>
+<td><code><span class='Value'>x</span> <span class='Function'>F</span><span class='Modifier2'>⎉</span><span class='Value'>r</span><span class='Ligature'>‿</span><span class='Number'>∞</span> <span class='Value'>y</span></code> where <code><span class='Value'>r</span></code> is <code><span class='Function'>F</span></code>'s left rank</td>
+</tr>
+<tr>
<td><code><span class='Function'>F</span><span class='Modifier'>`</span><span class='Function'>G</span><span class='Modifier'>`</span><span class='Function'>H</span><span class='String'>@</span><span class='Number'>.C</span></code></td>
<td><code><span class='Function'>C</span><span class='Modifier2'>◶</span><span class='Bracket'>⟨</span><span class='Function'>F</span><span class='Separator'>,</span><span class='Function'>G</span><span class='Separator'>,</span><span class='Function'>H</span><span class='Bracket'>⟩</span></code></td>
</tr>
@@ -624,11 +634,11 @@
<td><code><span class='Value'>x</span><span class='Modifier2'>⌾</span><span class='Paren'>(</span><span class='Value'>y</span><span class='Modifier2'>⊸</span><span class='Function'>⊏</span><span class='Paren'>)</span> <span class='Value'>z</span></code></td>
</tr>
<tr>
-<td><code><span class='Value'>x</span> <span class='Function'>F/</span> <span class='Number'>.G</span> <span class='Value'>y</span></code></td>
+<td><code><span class='Value'>x</span> <span class='Function'>F/</span> <span class='Number'>.</span> <span class='Function'>G</span> <span class='Value'>y</span></code></td>
<td><code><span class='Value'>x</span> <span class='Function'>F</span><span class='Modifier'>˝</span><span class='Modifier2'>∘</span><span class='Function'>G</span><span class='Modifier2'>⎉</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>∞</span> <span class='Value'>y</span></code></td>
</tr>
<tr>
-<td><code><span class='Function'>F</span><span class='Value'>:</span><span class='Number'>.G</span></code></td>
+<td><code><span class='Function'>F</span> <span class='Value'>:</span><span class='Number'>.</span> <span class='Function'>G</span></code></td>
<td><code><span class='Brace'>{</span><span class='Function'>𝕊</span><span class='Value'>:</span> <span class='Value'>𝕨</span><span class='Function'>F</span><span class='Value'>𝕩;</span> <span class='Function'>𝕊</span><span class='Modifier'>⁼</span><span class='Value'>:</span> <span class='Value'>𝕨</span><span class='Function'>G</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code></td>
</tr>
<tr>