vowels←'AEIOUaeiou'
'Hello APL Germany'(⍸∊)vowels ⍝ Where are the vowels?
'Hello APL Germany'⍸⍤∊vowels
'Hello APL Germany'(∨/∊)vowels ⍝ Are there any vowels?
'Hello APL Germany'∨/⍤∊vowels
'Hello APL Germany'(∧/∊)vowels ⍝ Are they all vowels?
'Hello APL Germany'∧/⍤∊vowels
≠
¶Does what it says
{1@(⍵⍳∪⍵)⊢⍬⍴⍨≢⍵}'Hello, World!'
≠'Hello, World!'
(⍉≠,⍪)'Hello, World!'
(≠⊢⍤/⊢)'Hello, World!'
⍥
¶Apply a pre-processor to arguments and then process the results
⍝ dop definition
OVER←{(⍵⍵ ⍺)⍺⍺ ⍵⍵ ⍵}
∇ r ← larg(PostProc OVER PreProc)rarg
⍝ tradop definition
r ← (PreProc larg) PostProc (PreProc rarg)
∇
'HELLO'≡⍥⎕C'hello'
'GROẞ MISTÄK'≡⍥⎕C'groß mistäk'
⍨
¶Derived function returns its operand
Dyalog '19: Tacit Techniques with Dyalog version 18.0 Operators | Marshall Lochbaum
Dyalog 17.1 defines ⍨
with a function operand ("Commute")
Dyalog 18.0 will allow an array operand: A⍨
is the function which returns A
.
f ← 1 2 3⍨
f 3 4⍴⍬
f¨3 4⍴⍬
The derived function A⍨
behaves identically to A{⍺⍺}
, or the train (A⊣⊢)
. But it's different from {A}
, which looks up the name A
when run.
A constant function derived with Constant can be used to make constant arrays matching another array's shape, or part of it.
Array | Shape |
---|---|
e⍨¨⍵ |
⍴⍵ |
e⍨⍤¯2⊢⍵ |
2↑⍴⍵ |
e⍨⍤3⊢⍵ |
¯3↓⍴⍵ |
e⍨⌿⍵ |
1↓⍴⍵ |
⍺∘.(e⍨)⍵ |
⍺,⍥⍴⍵ |
These forms will be optimised in 18.0 so that generating large arrays with Constant is as fast as using reshape.
It can be used in place of {(⍴⍵)⍴⊂⍺}
1 2 3{(⍴⍵)⍴⊂⍺}'hello'
1 2 3{⍺⍨¨⍵}'hello'
Primitives: atop ⍤
| constant ⍨
| over ⍥
| unique mask ≠
⎕C
Case folding/mapping system function
Dyalog '19: Cor(e) blimey, what's he up to now? | John Daintree
Jupyter notebooks / Binder
APLcart.info
APLwiki redux
⍝ You can execute APL code in cells like these
3⍴'WO'
$\LaTeX$
Look how we can put LaTeX formatted maths right beside equivalent APL
:
$e^{i \pi} = -1$
¯1=*○0J1 ⍝ APL in Markdown
*○0J1 ⍝ Executable APL
⎕←'this'
Using reveal.js, Jupyter Notebooks can be turned into slideshow presentations with little effort.
$ pip install --user jupyter_contrib_nbextensions
$ jupyter nbconvert SIGAPL2019.ipynb --to slides --ServePostProcessor.port=8888 --ServePostProcessor.ip='*' --post serve --SlidesExporter.reveal_theme=serif --ServePostProcessor.browser=none
https://github.com/Dyalog/dyalog-jupyter-kernel
There are of course instructions on the wiki...
... but the steps are basically the following:
Jupyter Lab
Jupyter Hub
Can't I quickly type up a notebook for my class or publication?
Funny you should ask...
We've created a Dyalog Jupyter Binder. Simply click the Launch Binder link from https://github.com/Dyalog19/D16 and Binder will spawn a docker container just for you!
Materials from the Dyalog'19 presentation:
https://github.com/Dyalog19/D16
Want to share? Send notebooks to notebooks@dyalog.com
⊆⌈
¶How do I ⍰ in APL?