User:⊂⍺m

From APL Wiki
Jump to navigation Jump to search

Learning APL and J

I recommend starting by mastering the foundational concepts: parsing, array rank, the rank operator, function rank, nested (i.e. successively applied) ranks, frames/cells, major cells ("items"), assembly and framing fill, empty arguments, frame agreement, enclose/box, indexing, the "each" and "every" operators, the i.-family of functions, and tacit combinators and trains (not foundational, but you'll encounter enough of them on APL Wiki and NuVoc). This makes everything else easier to learn, as so many primitives can be elegantly expressed in terms of rank (especially the hairy stuff like inner/outer product, decode/encode, index-of, etc.). Learn these concepts from anywhere and everywhere concurrently—primarily from APL Wiki and NuVoc, but also from the NARS and BQN documentation pages, and the relevant chapters from Learning APL and Mastering Dyalog APL.

Tools

custom string mapping for entering APL glyphs

I’ve never used an APL keyboard mapping. Instead, in the Emacs text editor (I specifically use Spacemacs), I use a custom string mapping (Xah Lee's Math Input Mode package) that associates input strings with corresponding characters to print. So I just enter gd<Shift><Space> for Grade Down , and even idioms like ax<Shift><Space> for ⍳≢⍴ (axes) and ax'<Shift><Space> for the tacit version ⍳∘≢∘⍴⍤. 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 mi<Shift><Space> (Mix) or ta<Shift><Space> (Take) for the glyph , 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. (<Shift><Space> for , and then <Shift><Space> again to change it to , coupling mnemonics in a natural way. Through successive <Shift><Space>'s you can cycle through ⊂⊆⊄⊈⊂—thus you can alternate between e.g. and by successive <Shift><Space>'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 i3 or Sway). Sample workflow: type some APL code in Emacs, press <Esc>yy 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—I find this a really convenient workflow.