diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-07-05 16:46:42 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-07-05 16:46:42 -0400 |
| commit | a25cb2b0bf26033c9bc778d816618a752d015d99 (patch) | |
| tree | 7056712bb10bf509764e04e56267f106e50dbea0 /doc/fromDyalog.md | |
| parent | df5ddc0ed2fe48411645228c6e2d596be239a0c6 (diff) | |
Somehow, all the docs have now been edited
Diffstat (limited to 'doc/fromDyalog.md')
| -rw-r--r-- | doc/fromDyalog.md | 33 |
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> |
