From d061b6cc5060eb12a22fe89660fc0ae2b3c397f7 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 5 Jun 2020 20:17:52 -0400 Subject: More and better Dyalog conversion tables --- FromDyalog.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/FromDyalog.md b/FromDyalog.md index 5ea3a6c4..3ec2800f 100644 --- a/FromDyalog.md +++ b/FromDyalog.md @@ -1,3 +1,7 @@ +A few tables to help users of Dyalog APL (or similar) get started quickly on BQN. + +## 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 | `⋆` | `√` | `∧` | `∨` | `¬` | `≠` | `<` | `>` | `≢` | `⥊` | `∾` | `≍` | @@ -9,3 +13,75 @@ Here are some closest equivalents in Dyalog APL for the BQN functions that don't |-------|------|---------|------|-----|-----|-----|-------|------|-----|-----|-----|-----|-----|-----| | Monad | `,⍀` | `⌽,⌽⍀⌽` | `⍳` | `⍸` | | `⍋` | `⍒` | `⊣⌿` | `⊃` | | `…` | `≠` | | `⌸` | | Dyad | `↑` | `↓` | `,⌿` | `⌿` | `⊆` | `⍸` | `⌽⍸⌽` | `⌷` | | `⍳` | `…` | `∊` | `⍷` | | + +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. + +| BQN | `¨` | `⌜` | `´` | `⎉` | `⍟` | `˜` | `∘` | `○` | `⟜` | +|--------|-----|------|-----|-----|-----|-----|-----|-----|-----| +| Dyalog | `¨` | `∘.` | `⌿` | `⍤` | `⍣` | `⍨` | `⍤` | `⍥` | `∘` | + +In BQN `⎉` is Rank and `∘` is Atop. Dyalog's Atop (`⍤`) and Over (`⍥`) were added in version 18.0. + +## For writing + +The tables below give approximate implementations of Dyalog primitives for the ones that aren't the same. First- and last-axis pairs are also mostly omitted. BQN just has the first-axis form, and you can get the last-axis form with `⎉1`. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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
+ + + + + + + + + + + + + + + + + + + + + + + +
Operators
Syntax Monadic Dyadic
´
or `
¨ ¨
˜
f.g f´∘g⍟1‿∞
∘.f f⌜
A∘g A⊸g
f∘B f⟜B
f∘g f⟜g
f⍤B f⎉B
f⍤g f∘g
f⍥g f○g
f@v f⌾(v⊸⊏)
f⍠B Uh
f⌸
f⌺B
A⌶
f& Nothing yet
-- cgit v1.2.3