aboutsummaryrefslogtreecommitdiff
path: root/doc/fromDyalog.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-07-05 16:46:42 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-07-05 16:46:42 -0400
commita25cb2b0bf26033c9bc778d816618a752d015d99 (patch)
tree7056712bb10bf509764e04e56267f106e50dbea0 /doc/fromDyalog.md
parentdf5ddc0ed2fe48411645228c6e2d596be239a0c6 (diff)
Somehow, all the docs have now been edited
Diffstat (limited to 'doc/fromDyalog.md')
-rw-r--r--doc/fromDyalog.md33
1 files changed, 18 insertions, 15 deletions
diff --git a/doc/fromDyalog.md b/doc/fromDyalog.md
index 6bdb99e6..c50d6028 100644
--- a/doc/fromDyalog.md
+++ b/doc/fromDyalog.md
@@ -17,8 +17,7 @@ BQN uses the [based array model](based.md), so that a Dyalog simple scalar corre
| Vector | List |
| Matrix | Table |
-BQN shares the terms "cell" and "major cell" with Dyalog, and uses
-"element" (which may mean different things to different Dyalog users) *not* for a 0-cell but for the value it contains.
+BQN shares the terms "[cell](array.md#cells)" and "major cell" with Dyalog, and uses "element" (which may mean different things to different Dyalog users) *not* for a 0-cell but for the value it contains.
### Roles
@@ -36,7 +35,7 @@ Dyalog uses value types (array, function, and so on) to determine syntax while B
BQN comments are written with `#`, not `⍝`. BQN strings use double quotes `""` while single quotes `''` enclose a character.
-BQN's functions use `{}`, like Dyalog's dfns. The names for inputs and self-reference are different:
+BQN's [block](block.md) functions use `{}`, like Dyalog's dfns. The names for inputs and self-reference are different:
| Dyalog | BQN |
|--------|-----|
@@ -47,15 +46,15 @@ BQN's functions use `{}`, like Dyalog's dfns. The names for inputs and self-refe
| `⍡⍡` | `𝔾` |
| `βˆ‡βˆ‡` | `𝕣` |
-BQN doesn't have guards: it uses modifiers or [control structures](control.md) instead. However, BQN function and modifier blocks have headers that allow pattern matching. See the [block](block.md) documentation.
+Blocks don't have guards exactly, but headers and predicates support some similar functionality (first-class functions can also be used for [control structures](control.md)). Headers can also be used to make a block more explicit about its inputs, more like a tradfn.
The assignment arrow `←` defines a new variable in a block, while `↩` modifies an existing one.
-BQN uses the ligature character `β€Ώ` for stranding, instead of plain juxtaposition. It also has a [list notation](arrayrepr.md#brackets) using `⟨⟩`.
+BQN uses the ligature character `β€Ώ` for stranding, instead of plain juxtaposition. It also has a [list notation](arrayrepr.md#brackets) using `⟨⟩`, and `[]` for higher-rank arrays.
## For reading
-Here are some closest equivalents in Dyalog APL for the BQN functions that don't use the same glyphs as APL. Correspondence can be approximate, and `⌽` is just used as a decorator to mean "reverse some things".
+Here are some closest equivalents in Dyalog APL for the BQN functions that don't use the same glyphs. Correspondence can be approximate, and `⌽` is just used as a decorator to mean "reverse some things".
| BQN | `⋆` | `√` | `∧` | `∨` | `Β¬` | `=` | `β‰ ` | `<` | `>` | `β‰’` | `β₯Š` |
|:-----:|:---:|:--------:|:-----:|:-----:|:-----:|:-----:|:---:|:---:|:---:|:---:|:---:|
@@ -74,11 +73,15 @@ 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 | `Β¨` | `⌜` | `˝` | `βŽ‰` | `⍟` | `˜` | `∘` | `β—‹` | `⟜` |
-|:------:|:---:|:----:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
-| Dyalog | `Β¨` | `∘.` | `⌿` | `⍀` | `⍣` | `⍨` | `⍀` | `β₯` | `∘` |
+| BQN | `Β¨` | `⌜` | `˝` | `βŽ‰` | `⍟` | `˜` | `∘` | `β—‹` | `⟜` |
+|:------:|:---:|:----:|:---:|:----:|:---:|:---:|:----:|:---:|:---:|
+| Dyalog | `Β¨` | `∘.` | `⌿` | `⍀A` | `⍣` | `⍨` | `⍀f` | `β₯` | `∘` |
-In BQN `βŽ‰` is Rank and `∘` is Atop. Dyalog's Atop (`⍀`) and Over (`β₯`) were added in version 18.0.
+Some other BQN modifiers have been proposed as future Dyalog extensions:
+
+| BQN | `⌾` | `βš‡` | `⊸` |
+|:---------------:|:---:|:---:|:---:|
+| Dyalog proposed | `⍒` [Under](https://aplwiki.com/wiki/Under) | `β₯` Depth | `⍛` [Reverse Compose](https://aplwiki.com/wiki/Reverse_Compose)
## For writing
@@ -91,7 +94,7 @@ The form `F⍣G` (Power with a function right operand; Power limit) must be impl
<tr><th> Glyph </th><th> Monadic </th><th> Dyadic </th> </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><code>Γ—Β΄1+↕</code> </td><td> <code>-˜(+Γ·β—‹(Γ—Β΄)⊒)1+β†•βˆ˜βŠ£</code></td></tr>
+<tr><td> <code>!</code> </td><td><code>Γ—Β΄1+↕</code> </td><td> <code>(-Γ·β—‹(Γ—Β΄)1⊸+)βŸœβ†•Λœ</code></td></tr>
<tr><td> <code>β—‹</code> </td><td> <code>Ο€βŠΈΓ—</code> </td><td> <code>β€’math</code></td> </tr>
<tr><td> <code>~</code> </td><td> <code>¬</code> </td><td> <code>¬∘∊/⊣</code></td> </tr>
<tr><td> <code>?</code> </td><td> <code>β€’rand.Rangeβš‡0</code> </td><td> <code>β€’rand.Deal</code></td></tr>
@@ -102,10 +105,10 @@ The form `F⍣G` (Power with a function right operand; Power limit) must be impl
<tr><td> <code>βͺ</code> </td><td> <code>β₯ŠΛ˜</code> </td><td> <code>∾</code></td> </tr>
<tr><td> <code>⌽</code> </td><td colspan=2><code>βŒ½βŽ‰0β€Ώ1</code></td> </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> <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> <code><⍟(0<≑)</code> </td><td> <code>(Β¬-ΛœβŠ’Γ—Β·+`»⊸>)βŠΈβŠ”</code></td></tr>
-<tr><td> <code>∊</code> </td><td> <code>{(βˆΎπ•ŠΒ¨)⍟(0<≑𝕩)β₯Šπ•©}</code></td><td> <code>∊</code></td> </tr>
+<tr><td> <code>∊</code> </td><td> <code>{(βˆΎπ•ŠΒ¨)⍟(0<≑)β₯Šπ•©}</code> </td><td> <code>∊</code></td> </tr>
<tr><td> <code>βŠƒ</code> </td><td colspan=2><code>βŠ‘</code></td> </tr>
<tr><td> <code>⍀</code> </td><td> </td><td> <code>{π•©βŒΎ(π•¨βŠΈ/)π•¨β‰ βŠΈβ†‘0↑𝕩}</code></td></tr>
<tr><td> <code>∩</code> </td><td> </td><td> <code>∊/⊣</code></td> </tr>
@@ -118,8 +121,8 @@ The form `F⍣G` (Power with a function right operand; Power limit) must be impl
<tr><td> <code>⍎</code> </td><td colspan=2><code>β€’BQN</code></td> </tr>
<tr><td> <code>⍕</code> </td><td colspan=2><code>β€’Fmt</code></td> </tr>
<tr><td> <code>βŠ₯</code> </td><td> </td><td> <code>{+⟜(π•¨βŠΈΓ—)Β΄βŒ½π•©}</code> </td></tr>
-<tr><td> <code>⊀</code> </td><td> </td><td> <code>{>𝕨|⌊∘÷`βŒΎβŒ½π•¨Β«Λœ<𝕩}</code></td></tr>
-<tr><td> <code>⌹</code> </td><td><code>Inverse</code> from <a href="https://github.com/mlochbaum/bqn-libs/blob/master/matrix.bqn">here</a></td><td><code>Solve</code></td></tr>
+<tr><td> <code>⊀</code> </td><td> </td><td> <code>{𝕨|>⌊∘÷`βŒΎβŒ½π•¨Β«Λœ<𝕩}</code></td></tr>
+<tr><td> <code>⌹</code> </td><td><code>Inverse</code>, </td><td> <code>Solve</code> from <a href="https://github.com/mlochbaum/bqn-libs/blob/master/matrix.bqn">here</a></td></tr>
<tr><td> <code>⌷</code> </td><td> N/A </td><td> <code>⊏</code></td> </tr>
</table>