Typing APL
APL is distinguished by its use of symbols (known as glyphs) to represent primitive functions and operators. You will quickly learn the meaning of these.
You will quickly learn to type these glyphs, using a method to suit your preference.
APL Fonts
APL glyphs require a font that supports them so that they can be displayed correctly. This font can be used both within a Dyalog Session and in other applications.
On most operating systems (macOS being one exception), installing Dyalog also installs the APL385 font.
avg ← +⌿÷1⌈⊣∘≢ ⍝ An example in the APL385 Unicode font
If you would like to use a different font, or want to be able to type APL glyphs outside Dyalog, then you will need to install that font and enable key mappings.
Typing APL Glyphs
APL glyphs can be typed in several different ways depending on your operating system and the application you are using.
The Language Bar
Many Dyalog user interfaces feature a language bar, for example, the Microsoft Windows IDE, Ride, TryAPL, and the APL Challenge; this makes it easy to access APL glyphs without using the keyboard. Hover the mouse pointer over a glyph to see its usage on interfaces that have tooltips, and click on it to insert it in the Session.
APL Keyboard
APL can be entered using a software layer on top of your normal keyboard input. This is comparable to how you can type many languages that do not use the Latin alphabet, or which use accents. There are two main types of APL keyboard input – a prefix key method and a shifting key method:
- With a prefix key, a particular key (often backtick ` on English layouts) is pressed and produces no output. The subsequent key press will produce a glyph. For example, ` followed by b produces ⊥ and `, Shift + 4 produces
⍋. - A shifting key is a key that, while held, enables glyph input when pressing other keys. For example, if xxxNOT COMPLETE!xxx
The default Dyalog input method depends on your operating system:
- in the Microsoft Windows IDE, both shifting key input using Ctrl and a customisable prefix key input are supported by default.
- on other platforms (including Ride), the prefix method is the default.
NOTE: A physical keyboard is not required to enter Dyalog glyphs. However, if you would like one, several options are available.
Keyboard Layout Diagrams
Keyboard layouts can vary between operating systems, locales (country and language-specific layouts), and operating systems.
Dyalog APL’s standard UK English layout is as follows:
┌────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬─────────┐
│¬ ⌺ │! ⌶ │" ⍫ │£ ⍒ │$ ⍋ │% ⌽ │^ ⍉ │& ⊖ │* ⍟ │( ⍱ │) ⍲ │_ ! │+ ⌹ │Backspace│
│` ⋄ │1 ¨ │2 ¯ │3 < │4 ≤ │5 = │6 ≥ │7 > │8 ≠ │9 ∨ │0 ∧ │- × │= ÷ │ │
├────┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬──────┤
│Tab │Q │W │E ⍷ │R │T ⍨ │Y │U │I ⍸ │O ⍥ │P ⍣ │{ ⍞ │} ⍬ │Enter │
│ │q ? │w ⍵ │e ∊ │r ⍴ │t ~ │y ↑ │u ↓ │i ⍳ │o ○ │p * │[ ← │] → │ │
├───────┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┬───┴┐ │
│Caps │A │S │D │F ⍛ │G │H │J ⍤ │K ⌸ │L ⌷ │: ≡ │@ ≢ │~ │ │
│Lock │a ⍺ │s ⌈ │d ⌊ │f _ │g ∇ │h ∆ │j ∘ │k ' │l ⎕ │; ⍎ │' ⍕ │# │ │
├──────┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴──┬─┴────┴─────┤
│Shift │| ⊣ │Z ⊆ │X │C │V │B │N │M │< ⍪ │> ⍙ │? ⍠ │Shift │
│ │\ ⊢ │z ⊂ │x ⊃ │c ∩ │v ∪ │b ⊥ │n ⊤ │m | │, ⍝ │. ⍀ │/ ⌿ │ │
├──────┴┬───┴─┬──┴───┬┴────┴────┴────┴────┴────┴┬───┴──┬─┴────┼─────┬──────┤
│Ctrl │Win │Alt │ │Alt Gr│Win │Menu │Ctrl │
│ │ │ │ │ │ │ │ │
└───────┴─────┴──────┴──────────────────────────┴──────┴──────┴─────┴──────┘
Diagrams for other languages and layouts are shown on the dfns website notes about keyboards.
Alternative Input Methods
Other input methods have been developed by APL users and are described on the APL Wiki page on Typing Glyphs.