From 374de13fa6db5e51113223a2d9e3608cda30f5d9 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 4 Jul 2020 18:32:58 -0400 Subject: Tweaks to Dyalog translation tables --- FromDyalog.md | 80 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/FromDyalog.md b/FromDyalog.md index f574b39c..e0527cfb 100644 --- a/FromDyalog.md +++ b/FromDyalog.md @@ -1,18 +1,18 @@ -A few tables to help users of Dyalog APL (or similar) get started quickly on BQN. +A few tables to help users of Dyalog APL (or similar) get started quickly on BQN. Here we assume `⎕ML` is 1 for Dyalog. ## 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". -| BQN | `⋆` | `√` | `∧` | `∨` | `¬` | `≠` | `<` | `>` | `≢` | `⥊` | `∾` | `≍` | -|-------|-----|--------|-------|-------|-------|-----|-----|-----|-----|-----|-------|--------| -| Monad | `*` | `*∘÷⍨` | `[⍋]` | `[⍒]` | `~` | `≢` | `⊂` | `↑` | `⍴` | `,` | `⊃,⌿` | `↑,⍥⊂` | -| Dyad | | | `∧` | `∨` | `1+-` | `≠` | `<` | `>` | `≢` | `⍴` | `⍪` | | +| BQN | `⋆` | `√` | `∧` | `∨` | `¬` | `≠` | `<` | `>` | `≢` | `⥊` | `∾` | `≍` | +|-------|-----|----------|-------|-------|-------|-----|-----|-----|-----|-----|-------|--------| +| Monad | `*` | `*∘(÷2)` | `[⍋]` | `[⍒]` | `~` | `≢` | `⊂` | `↑` | `⍴` | `,` | `⊃,⌿` | `↑,⍥⊂` | +| Dyad | `*` | `*∘÷⍨` | `∧` | `∨` | `1+-` | `≠` | `<` | `>` | `≢` | `⍴` | `⍪` | `↑,⍥⊂` | | BQN | `↑` | `↓` | `↕` | `/` | `⍋` | `⍒` | `⊏` | `⊑` | `⊐` | `⊒` | `∊` | `⍷` | `⊔` | |-------|------|---------|------|-----|-----|-------|------|-----|-----|-----|-----|-----|------------| -| Monad | `,⍀` | `⌽,⌽⍀⌽` | `⍳` | `⍸` | `⍋` | `⍒` | `⊣⌿` | `⊃` | | `…` | `≠` | | `⌸` or `⊆` | -| Dyad | `↑` | `↓` | `,⌿` | `⌿` | `⍸` | `⌽⍸⌽` | `⌷` | | `⍳` | `…` | `∊` | `⍷` | | +| Monad | `,⍀` | `⌽,⌽⍀⌽` | `⍳` | `⍸` | `⍋` | `⍒` | `⊣⌿` | `⊃` | | `…` | `≠` | `∪` | `⌸` | +| Dyad | `↑` | `↓` | `,⌿` | `⌿` | `⍸` | `⌽⍸⌽` | `⌷` | `⊃` | `⍳` | `…` | `∊` | `⍷` | `⌸` or `⊆` | Modifiers and combinators 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. @@ -28,38 +28,38 @@ The tables below give approximate implementations of Dyalog primitives for the o - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Functions
Glyph Monadic Dyadic
*
⋆⁼
! Implement it yourself
Some complex exponential stuff, maybe
~ ¬ ¬∘∊/⊣
? Library?
¬∘∧
¬∘∨
, ∾⎉1
∾˘
>
< +`⊸⊔
<⍟(0<≡)
{0=≡𝕩:⥊𝕩⋄∾⥊∇¨𝕩}
/⁼
∊/⊣
∊⊸/ ⊣∾∊˜¬⊸/⊢
/
Give up
Give up
To be decided
To be decided
+´∘×⎉1‿∞⁼ I guess
N/A
Glyph Monadic Dyadic
*
⋆⁼
! Implement it yourself
Some complex exponential stuff, maybe
~ ¬ ¬∘∊/⊣
? Library?
¬∘∧
¬∘∨
, ∾⎉1
⥊˘
>
< +`⊸⊔
<⍟(0<≡)
{0=≡𝕩:⥊𝕩⋄∾⥊∇¨𝕩}
/⁼
∊/⊣
⊣∾∊˜¬⊸/⊢
/
Give up
Give up
To be decided
{+⟜(𝕨⊸×)´⌽𝕩}
{𝕨|1↓⌊∘÷`⌾⌽𝕨∾<𝕩}
+´∘×⎉1‿∞⁼ I guess
N/A
@@ -80,7 +80,7 @@ The tables below give approximate implementations of Dyalog primitives for the o - + -- cgit v1.2.3
f⍥g f○g
f@v f⌾(v⊸⊏)
f⍠B Uh
f⌸ ∪⊸⊐⊔↕∘≠∪⊸⊐⊸⊔
f⌸ ⍷⊸⊐⊔↕∘≠⍷⊸⊐⊸⊔
f⌺B
A⌶
f& Nothing yet