User:⊂⍺m: Difference between revisions

Jump to navigation Jump to search
331 bytes removed ,  20:42, 10 July 2023
m
Line 34: Line 34:
== Tools ==
== Tools ==
=== custom string mapping for entering APL glyphs ===
=== custom string mapping for entering APL glyphs ===
I’ve never used an APL keyboard mapping! Instead, in the Emacs text editor ([https://github.com/syl20bnr/spacemacs Spacemacs], in my case), I use a [https://github.com/cchando/config/blob/master/.emacs.d/elpa/xah-math-input-20200217.740/xah-math-input.el#L807 custom string mapping] ([http://xahlee.info/emacs/emacs/xmsi-math-symbols-input.html Xah Lee's Math Input Mode] package) that associates input strings with corresponding characters to print. So I just enter <code inline>gd<Shift><Space></code> for Grade Down <syntaxhighlight lang=apl inline>⍒</syntaxhighlight>, and even idioms like <code inline>ax<Shift><Space></code> for <syntaxhighlight lang=apl inline>⍳≢⍴</syntaxhighlight> (axes) and <code inline>ax'<Shift><Space></code> for the tacit version <syntaxhighlight lang=apl inline>⍳∘≢∘⍴⍤</syntaxhighlight>. Truly coding at the speed of thought! The other advantage here is that it uses function mnemonics rather than glyph mnemonics—e.g. you can type either <code>mi</code> (Mix) or <code inline>ta</code> (Take) for the glyph <syntaxhighlight lang=apl inline>↑</syntaxhighlight>, so you're typing in accordance with what you want to do, rather than having to type, say, "au" for the visual mnemonic "arrow up" corresponding to the glyph. Furthermore, you can type e.g. <code inline>(<Shift><Space></code> for <syntaxhighlight lang=apl inline>⊂</syntaxhighlight>, and then <code inline><Shift><Space></code> again to change it to <syntaxhighlight lang=apl inline>⊆</syntaxhighlight>, coupling mnemonics in a natural way. Through successive <code inline><Shift><Space></code>'s you can cycle through <syntaxhighlight lang=apl inline>⊂⊆⊄⊈⊂</syntaxhighlight>—thus you can alternate between e.g. <syntaxhighlight lang=apl inline>⍳</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍸</syntaxhighlight> by successive <code inline><Shift><Space></code>'s as well. In Emacs, such mapping functionality is easy to write, whereas most IDEs and text editors are not extensible enough to allow implementing this at all. I'm thinking about writing the same functionality for the Kakoune editor since it's much more cleanly designed than Emacs…
I’ve never used an APL keyboard mapping! Instead, in the Emacs text editor ([https://github.com/syl20bnr/spacemacs Spacemacs], in my case), I use a [https://github.com/cchando/config/blob/master/.emacs.d/elpa/xah-math-input-20200217.740/xah-math-input.el#L807 custom string mapping] ([http://xahlee.info/emacs/emacs/xmsi-math-symbols-input.html Xah Lee's Math Input Mode] package) that associates input strings with corresponding characters to print. So I just enter <code inline>gd<Shift><Space></code> for Grade Down <syntaxhighlight lang=apl inline>⍒</syntaxhighlight>, and even idioms like <code inline>ax<Shift><Space></code> for <syntaxhighlight lang=apl inline>⍳≢⍴</syntaxhighlight> (axes) and <code inline>ax'<Shift><Space></code> for the tacit version <syntaxhighlight lang=apl inline>⍳∘≢∘⍴⍤</syntaxhighlight>. Truly coding at the speed of thought! The other advantage here is that it uses function mnemonics rather than glyph mnemonics—e.g. you can type either <code>mi<Shift><Space></code> (Mix) or <code inline>ta<Shift><Space></code> (Take) for the glyph <syntaxhighlight lang=apl inline>↑</syntaxhighlight>, so you're typing in accordance with what you want to do, rather than having to type, say, "au" for the visual mnemonic "arrow up" corresponding to the glyph. Furthermore, you can type e.g. <code inline>(<Shift><Space></code> for <syntaxhighlight lang=apl inline>⊂</syntaxhighlight>, and then <code inline><Shift><Space></code> again to change it to <syntaxhighlight lang=apl inline>⊆</syntaxhighlight>, coupling mnemonics in a natural way. Through successive <code inline><Shift><Space></code>'s you can cycle through <syntaxhighlight lang=apl inline>⊂⊆⊄⊈⊂</syntaxhighlight>—thus you can alternate between e.g. <syntaxhighlight lang=apl inline>⍳</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍸</syntaxhighlight> by successive <code inline><Shift><Space></code>'s as well.


Even if you don't want to generally use Emacs as a text editor, switching between a small Emacs window and your APL IDE or command-line interpreter is trivial if you're using a tiled window manager (I use [https://i3wm.org/ i3] or [https://swaywm.org/ Sway]). Sample workflow: type some APL code in Emacs, press <code inline><Esc>-yy</code> to copy the line of text, press LogoKey-h to move the window focus leftward to the Dyalog interpreter, press Ctrl-v to paste it in and evaluate it, then press LogoKey-l to move back to the Emacs window—a really convenient workflow. With as many barriers that exist to learning APL, I feel like the last thing a beginner needs is the added task of memorizing a keyboard layout.
Even if you don't want to generally use Emacs as a text editor, switching between a small Emacs window and your APL IDE or command-line interpreter is trivial if you're using a tiled window manager (I use [https://i3wm.org/ i3] or [https://swaywm.org/ Sway]). Sample workflow: type some APL code in Emacs, press <code inline><Esc>-yy</code> to copy the line of text, press <code inline><LogoKey>h</code> to move the window focus leftward to the Dyalog interpreter, press <code inline><Ctrl>v</code> to paste it in and evaluate it, then press <code inline>LogoKey-l</code> to move back to the Emacs window—a really convenient workflow.


== Works in progress ==
== Works in progress ==
trusted
83

edits

Navigation menu