Extended Dyalog APL

From APL Wiki
Revision as of 20:58, 10 September 2022 by Adám Brudzewsky (talk | contribs) (Text replacement - "</source>" to "</syntaxhighlight>")
Jump to navigation Jump to search

Extended Dyalog APL features extended domains of existing primitives and quad names and adds a few new ones to Dyalog APL. It was an experimental project that is no longer maintained. Quoting from project README.md:

This project serves as a breeding ground for ideas. While some have been adopted into Dyalog APL proper, it is unlikely that many will be. Furthermore, Dyalog 18.0 gave a different meaning to monadic ≠ than proposed here, leaving Extended Dyalog APL as a deadend.

Influence

Many of the extensions have been adopted into dzaima/APL, while Dyalog APL added Constant (<source lang=apl inline>⍨</syntaxhighlight>) and introduced non-experimental case conversion as a <source lang=apl inline>⎕C</syntaxhighlight> function rather than the proposed operator. Dyalog is also considering adding Reverse Compose, From, and Depth.

Features

The following extensions were made:

Name Glyph Type* Extension
Back Slash <source lang=apl inline>\</syntaxhighlight> 🔶 <source lang=apl inline>∘.f</syntaxhighlight>when dyadic, allows short and/or multiple left args
Back Slash Bar <source lang=apl inline>⍀</syntaxhighlight> 🔶 <source lang=apl inline>⊢∘f</syntaxhighlight>when dyadic, allows short and/or multiple left args
Bullet <source lang=apl inline>∙</syntaxhighlight> 🔺 Inner product and Alternant
Circle Diaeresis <source lang=apl inline>⍥</syntaxhighlight> 🔺 Over and Depth
Circle Jot <source lang=apl inline>⌾</syntaxhighlight> 🔺 Complex/Imaginary
Del Diaeresis <source lang=apl inline>⍢</syntaxhighlight> 🔺 Under (a.k.a. Dual)
Del Tilde <source lang=apl inline>⍫</syntaxhighlight> 🔺 Obverse;<source lang=apl inline>⍺⍺</syntaxhighlight>but with inverse<source lang=apl inline>⍵⍵</syntaxhighlight>
Diaeresis <source lang=apl inline>¨</syntaxhighlight> 🔵 allows constant operand
Divide <source lang=apl inline>÷</syntaxhighlight> 🔵 monadic converts letters to title case when possible
Dollar Sign <source lang=apl inline>$</syntaxhighlight> 🔺 string enhancement ${1}:<source lang=apl inline>1⊃⍺</syntaxhighlight>, ${expr}:<source lang=apl inline>⍎expr</syntaxhighlight>,<source lang=apl inline>\n</syntaxhighlight>:JSON
Down Arrow <source lang=apl inline>↓</syntaxhighlight> 🔵 allows long<source lang=apl inline>⍺</syntaxhighlight>
Down Shoe <source lang=apl inline>∪</syntaxhighlight> 🔵 allows rank>1
Downstile <source lang=apl inline>⌊</syntaxhighlight> 🔵 monadic lowercases letters
Down Tack <source lang=apl inline>⊤</syntaxhighlight> 🔶 2s as default left argument
Ellipsis <source lang=apl inline>…</syntaxhighlight> 🔺 fill sequence gaps (dfns workspace's<source lang=apl inline>to⍤1</syntaxhighlight>
Epsilon Underbar <source lang=apl inline>⍷</syntaxhighlight> 🔶 monadic is Type<source lang=apl inline>∊</syntaxhighlight>with<source lang=apl inline>⎕ML←0</syntaxhighlight>
Equals <source lang=apl inline>=</syntaxhighlight> 🔶 with TAO; monad: is-type
Greater Than <source lang=apl inline>></syntaxhighlight> 🔶 with TAO; monad: is-strictly-negative/is-visible
Greater Than Or Equal To <source lang=apl inline>≥</syntaxhighlight> 🔶 with TAO; monad: is non-positive/is-not-control-character
house <source lang=apl inline>⌂</syntaxhighlight> 🔺 prefix for contents of dfns workspace
infinity <source lang=apl inline>∞</syntaxhighlight> 🔺 largest integer (for use with<source lang=apl inline>⍤</syntaxhighlight>and<source lang=apl inline>⍣</syntaxhighlight>)
Iota <source lang=apl inline>⍳</syntaxhighlight> 🔵 Unicode version of dfns workspace's <source lang=apl inline>iotag</syntaxhighlight>
Iota Underbar <source lang=apl inline>⍸</syntaxhighlight> 🔵 allows duplicates/non-Booleans
Iota Underbar Inverse <source lang=apl inline>⍸⍣¯1</syntaxhighlight> 🔵 given<source lang=apl inline>r</syntaxhighlight>, finds<source lang=apl inline>n</syntaxhighlight>so that<source lang=apl inline>r≡⍸n</syntaxhighlight>
Jot Diaeresis <source lang=apl inline>⍤</syntaxhighlight> 🔵 allows constant left operand, Atop with function right operand
Jot Underbar <source lang=apl inline>⍛</syntaxhighlight> 🔺 reverse composition<source lang=apl inline>X f⍛g Y</syntaxhighlight>is<source lang=apl inline>(f X) g Y</syntaxhighlight>
Left Shoe <source lang=apl inline>⊂</syntaxhighlight> 🔵 allows partitioning along multiple trailing axes, with short <source lang=apl inline>⍺</syntaxhighlight>s, and inserting/appending empty partitions
Left Shoe Stile <source lang=apl inline>⍧</syntaxhighlight> 🔺 monad: nub-sieve; dyad: count-in
Left Shoe With Axis <source lang=apl inline>⊂[k]</syntaxhighlight> 🔵 as<source lang=apl inline>⊂</syntaxhighlight>, but called with left operand
Less Than <source lang=apl inline><</syntaxhighlight> 🔶 with TAO; monad: is-strictly-positive/is-control-character
Less Than Or Equal To <source lang=apl inline>≤</syntaxhighlight> 🔶 with TAO ; monad: is-non-negative/is-invisible
Minus <source lang=apl inline>-</syntaxhighlight> 🔵 monadic flips letter case
macron <source lang=apl inline>¯</syntaxhighlight> 🔵 as prefix to name or primitive means its inverse
negative Infinity <source lang=apl inline>¯∞</syntaxhighlight> 🔺 smallest integer (for use with<source lang=apl inline>⍣</syntaxhighlight>)
Nand <source lang=apl inline>⍲</syntaxhighlight> 🔶 monad: not all equal to type
Nor <source lang=apl inline>⍱</syntaxhighlight> 🔶 monad: not any equal to type
Not Equal To <source lang=apl inline>≠</syntaxhighlight> 🔶 with TAO; monad: is-non-type
Percent <source lang=apl inline>%</syntaxhighlight> 🔺 <source lang=apl inline>f%</syntaxhighlight>and<source lang=apl inline>A%</syntaxhighlight>: probability-logical function (mapping arrays)
Quad Diamond <source lang=apl inline>⌺</syntaxhighlight> 🔶 auto-extended<source lang=apl inline>⍵⍵</syntaxhighlight>, allows small<source lang=apl inline>⍵</syntaxhighlight>, optional edge spec(s) (0:Zero; 1:Repl; 2:Rev; 3:Mirror; 4:Wrap; -:Twist) with masks as operand's<source lang=apl inline>⍺</syntaxhighlight>
Question Mark <source lang=apl inline>?</syntaxhighlight> 🔵 <source lang=apl inline>⍺?¯⍵</syntaxhighlight>as norm dist stddev <source lang=apl inline>⍵</syntaxhighlight>and optional mean<source lang=apl inline>⍺←0</syntaxhighlight>
Rho <source lang=apl inline>⍴</syntaxhighlight> 🔵 allows omitting one dimension length with<source lang=apl inline>¯1</syntaxhighlight>
Right Shoe Underbar <source lang=apl inline>⊇</syntaxhighlight> 🔺 monadic discloses if scalar, dyadic indexes sanely
Right Shoe Underbar With Axis <source lang=apl inline>⊇[k]</syntaxhighlight> 🔺 as above, but called with left operand
Root <source lang=apl inline>√</syntaxhighlight> 🔺 (Square) Root
Semicolon Underbar <source lang=apl inline>⍮</syntaxhighlight> 🔺 (Half) Pair; use<source lang=apl inline>↑⍤⍮</syntaxhighlight>to add axis
Slash <source lang=apl inline>/</syntaxhighlight> 🔵 allows short and/or multiple left args
Slash Bar <source lang=apl inline>⌿</syntaxhighlight> 🔵 allows short and/or multiple left args
Star Diaeresis <source lang=apl inline>⍣</syntaxhighlight> 🔵 allows non-scalar right operand incl.<source lang=apl inline>∞</syntaxhighlight>and<source lang=apl inline>¯∞</syntaxhighlight>and array left operand
Stile </syntaxhighlight> 🔵 monadic normalises letters to lowercase (upper then lower)
Stile Tilde <source lang=apl inline>⍭</syntaxhighlight> 🔺 monadic is factors; dyadic depends on<source lang=apl inline>⍺</syntaxhighlight>: 0=non-prime?, 1=prime?, ¯1=primes less than<source lang=apl inline>⍵</syntaxhighlight>, ¯2=<source lang=apl inline>⍵</syntaxhighlight>th prime, 4=next prime, ¯4=prev prime
Tilde <source lang=apl inline>~</syntaxhighlight> 🔵 monadic allows probabilities, dyadic allows rank>1
Tilde Diaeresis <source lang=apl inline>⍨</syntaxhighlight> 🔵 allows constant operand
Times <source lang=apl inline>×</syntaxhighlight> 🔵 set/query letter case (lower:<source lang=apl inline>¯1</syntaxhighlight>, title:<source lang=apl inline>0</syntaxhighlight>, upper:<source lang=apl inline>1</syntaxhighlight>)
Up Arrow <source lang=apl inline>↑</syntaxhighlight> 🔵 allows long<source lang=apl inline>⍺</syntaxhighlight>
Up Shoe <source lang=apl inline>∩</syntaxhighlight> 🔶 monadic is self-classify; dyadic allows rank>1
Upstile <source lang=apl inline>⌈</syntaxhighlight> 🔵 monadic uppercases letters
Up Tack <source lang=apl inline>⊥</syntaxhighlight> 🔶 2 as default left argument
Vel <source lang=apl inline>∨</syntaxhighlight> 🔶 monadic is Descending Sort
Wedge <source lang=apl inline>∧</syntaxhighlight> 🔶 monadic is Ascending Sort
Case Convert <source lang=apl inline>⎕C</syntaxhighlight> 🔺 <source lang=apl inline>fn ⎕C</syntaxhighlight>applies case-insensitively,<source lang=apl inline>array ⎕C</syntaxhighlight>case-folds
Error Message <source lang=apl inline>⎕EM</syntaxhighlight> 🔺 Self-inverse<source lang=apl inline>⎕EM</syntaxhighlight>
Namespace <source lang=apl inline>⎕NS</syntaxhighlight> 🔵 allows<source lang=apl inline>⎕NS names values</syntaxhighlight>(tries to resolve<source lang=apl inline>⎕OR</syntaxhighlight>s)
Namespace inverse <source lang=apl inline>⎕NS⍣¯1</syntaxhighlight> 🔺 allows<source lang=apl inline>(names values)←⎕NS⍣¯1⊢ns</syntaxhighlight>(returns<source lang=apl inline>⎕OR</syntaxhighlight>s for ns/fns)
Unicode Convert <source lang=apl inline>⎕UCS</syntaxhighlight> 🔵 scalar when monadic

* 🔺 means new feature 🔶 means added valence 🔵 means expanded domain


APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLdzaima/APLExtended Dyalog APLGNU APLKAPNARS2000Pometo
Historical A Programming LanguageA+ (A) ∙ APL#APL\360APL/700APL\1130APL\3000APL.68000APL*PLUSAPL.jlAPL.SVAPLXIverson notationIVSYS/7090NARSngn/aplopenAPLOperators and FunctionsPATRowanSAXSHARP APLRationalized APLVisualAPL (APLNext) ∙ VS APLYork APL
Derivatives AHPLBQNCoSyELIGleeIIvyJJellyJellyfishK (Q, KDB+) ∙ Lang5NialRAD
Overviews Timeline of array languagesTimeline of influential array languagesFamily tree of array languages