Mnemonics: Difference between revisions
Tags: Mobile edit Mobile web edit 

(12 intermediate revisions by 3 users not shown)  
Line 5:  Line 5:  
Many glyphs have meaning [[Comparison_with_traditional_mathematics#Identicalidentical to their mathematical counterparts]].  Many glyphs have meaning [[Comparison_with_traditional_mathematics#Identicalidentical to their mathematical counterparts]].  
<  <syntaxhighlight lang=apl inline>⋄</syntaxhighlight> (Diamond) separates statements. That is, no functions or operators can break through <syntaxhighlight lang=apl inline>⋄</syntaxhighlight>, just as diamonds are virtually indestructible.  
<  <syntaxhighlight lang=apl inline>⌺</syntaxhighlight> looks like a <syntaxhighlight lang=apl inline>⋄</syntaxhighlight>shaped [[Stencil]] laid on a piece of paper, <syntaxhighlight lang=apl inline>⎕</syntaxhighlight>.  
<  <syntaxhighlight lang=apl inline>!</syntaxhighlight> is [[Binomial]] in addition to [[Factorial]], as the two are closely related.  
[[File:I beam HEB 100.pngthumb[[Ibeam]] <  [[File:I beam HEB 100.pngthumb[[Ibeam]] <syntaxhighlight lang=apl inline>⌶</syntaxhighlight> does look like an [[wikipedia:IbeamIbeam]]]]  
<  <syntaxhighlight lang=apl inline>⌶</syntaxhighlight> ([[Ibeam]]) calls system services. APL was originally developed at [[IBM]], so system services were also IBM services. <syntaxhighlight lang=apl inline>⌶</syntaxhighlight> is an [[wikipedia:IbeamIbeam]] and ''Ibeam'' is pronounced almost identically to ''IBM''.  
<  <syntaxhighlight lang=apl inline>@</syntaxhighlight> applies a function or substitutes elements ''[[at]]'' specific locations.  
[[File:Bristol Type 223 topview silhouette.pngthumbThe [[Grade]] glyphs <  [[File:Bristol Type 223 topview silhouette.pngthumbThe [[Grade]] glyphs <syntaxhighlight lang=apl inline>⍋</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍒</syntaxhighlight> look like [[wikipedia:supersonic transportsupersonic transport]]s.]]  
<  <syntaxhighlight lang=apl inline>⍋</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍒</syntaxhighlight> give the indices ([[grade]]s) needed to sort ascending and descending respectively, and look like an ascending and descending supersonic transport, respectively.  
<  <syntaxhighlight lang=apl inline>⌽</syntaxhighlight>, <syntaxhighlight lang=apl inline>⊖</syntaxhighlight>, and <syntaxhighlight lang=apl inline>⍉</syntaxhighlight> [[reverse]] or [[transpose]] an array over a given [[axis]]. The <syntaxhighlight lang=apl inline>○</syntaxhighlight> part of the glyphs symbolise the array, while the line component (<syntaxhighlight lang=apl inline></syntaxhighlight>, <syntaxhighlight lang=apl inline>\</syntaxhighlight>, or <syntaxhighlight lang=apl inline></syntaxhighlight>) indicates the line across which the reversal/transposal is done.  
[[File:TreeLog.jpgthumbThe [[Log]] glyph <  [[File:TreeLog.jpgthumbThe [[Log]] glyph <syntaxhighlight lang=apl inline>⍟</syntaxhighlight> looks like a tree log.]]  
<  <syntaxhighlight lang=apl inline>⍟</syntaxhighlight> looks like the crosssection of a tree [[log]]  
<  <syntaxhighlight lang=apl inline>⍱</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍲</syntaxhighlight> ([[Nor]] and [[Nand]]) have the [[Not]] glyph <syntaxhighlight lang=apl inline>~</syntaxhighlight> on top of or overlaid on the [[Or]] glyph <syntaxhighlight lang=apl inline>∨</syntaxhighlight> and [[And]] glyph <syntaxhighlight lang=apl inline>∧</syntaxhighlight> respectively.  
<  <syntaxhighlight lang=apl inline>×</syntaxhighlight> can be seen as an <math>x</math> when monadic, indicating the unknown [[sign]] to be determined.  
<  <syntaxhighlight lang=apl inline>+</syntaxhighlight> negates the imaginary part (that is, it [[conjugate]]s) by analogy to monadic <syntaxhighlight lang=apl inline></syntaxhighlight> which negates both the real and the imaginary parts.  
<  <syntaxhighlight lang=apl inline>÷</syntaxhighlight> takes a default left argument of <syntaxhighlight lang=apl inline>1</syntaxhighlight> (thus computing the [[reciprocal]]), that being the [[identity element]] of [[division]].  
<  <syntaxhighlight lang=apl inline>⌹</syntaxhighlight> is [[matrix divide]] with a <syntaxhighlight lang=apl inline>⎕</syntaxhighlight> symbolising a matrix and an inscribed <syntaxhighlight lang=apl inline>÷</syntaxhighlight> for "divide".  
<  <syntaxhighlight lang=apl inline>?</syntaxhighlight> symbolises the unknown, and thus [[roll]]s dice and [[deal]]s cards randomly.  
<  <syntaxhighlight lang=apl inline>⍺</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍵</syntaxhighlight> are the leftmost and rightmost letters of the [[wikipedia:Greek alphabetGreek alphabet]]. They therefore denote the left and right arguments of [[dfn]]s, respectively.  
<  <syntaxhighlight lang=apl inline>∊</syntaxhighlight> is the Greek letter [[Epsilon]] which corresponds to the letter ''E'' for [[Enlist]] and [[Element of]].  
<  <syntaxhighlight lang=apl inline>⍴</syntaxhighlight> is the Greek letter [[Rho]] which corresponds to the letter ''R'' for [[Reshape]].  
<  <syntaxhighlight lang=apl inline>~</syntaxhighlight> is [[Not]] when monadic, but its dyadic form, [[Without]], can also be remembered as ''but not''.  
<  <syntaxhighlight lang=apl inline>⍨</syntaxhighlight> is a monadic operator that looks like a face. When its derived function is applied monadically, it can be called ''[[self]]ie'', in that it applies the operand function to the argument with the argument itself as left argument too.  
<  <syntaxhighlight lang=apl inline>↑</syntaxhighlight> and <syntaxhighlight lang=apl inline>↓</syntaxhighlight> ([[Mix]] and [[Split]]) increase and decrease rank (if possible) when used monadically.  
<  <syntaxhighlight lang=apl inline>↓</syntaxhighlight> [[drop]]s elements, and so it points down, the direction in which things are dropped. Take uses <syntaxhighlight lang=apl inline>↑</syntaxhighlight> by analogy.  
<  <syntaxhighlight lang=apl inline>⍳</syntaxhighlight> is the Greek letter [[Iota]] which corresponds to the letter ''I'' for [[Index generator]] and [[Index of]].  
<  <syntaxhighlight lang=apl inline>⍸</syntaxhighlight> is also the Greek letter [[Iota]] which corresponds to the letter ''I'' for [[Indices]] and [[Interval Index]].  
<  <syntaxhighlight lang=apl inline>○</syntaxhighlight> is a circle for [[Circular]] functions and the ratio between the circumference and the diameter of a circle, [[Pi timesPi]].  
<  <syntaxhighlight lang=apl inline>⍥</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍤</syntaxhighlight> ([[Over]] and [[Atop]]) both apply the left operand after the right operand. However, <syntaxhighlight lang=apl inline>⍥</syntaxhighlight> has a larger "circle of influence" in that it applies its right operand twice (once on each argument) while <syntaxhighlight lang=apl inline>⍤</syntaxhighlight> only applies it once (between the arguments).  
<  <syntaxhighlight lang=apl inline>*</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍣</syntaxhighlight> repeatedly apply multiplication and a function, respectively. The star symbolises [[power (function)]]/[[power (operator)]].  
<  <syntaxhighlight lang=apl inline>←</syntaxhighlight> [[assign]]s by putting the value on its right into the name on its left.  
<  <syntaxhighlight lang=apl inline>→</syntaxhighlight> points at the destination it is [[branch]]ing to.  
<  <syntaxhighlight lang=apl inline>⍬</syntaxhighlight> ([[Zilde]]) is a combination of <syntaxhighlight lang=apl inline>~</syntaxhighlight> for [[Without]] and <syntaxhighlight lang=apl inline>0</syntaxhighlight> indicating numbers. Indeed, it is the "vector without numbers", equivalent to <syntaxhighlight lang=apl inline>0~0</syntaxhighlight>.  
<  <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> and <syntaxhighlight lang=apl inline>⊢</syntaxhighlight> point a finger towards the [[left]] and [[right]], which are exactly the argument they, respectively, return.  
[[File:Computer console.jpgthumbThe [[Quad]] glyph <  [[File:Computer console.jpgthumbThe [[Quad]] glyph <syntaxhighlight lang=apl inline>⎕</syntaxhighlight> looks like a console.]]  
<  <syntaxhighlight lang=apl inline>⎕</syntaxhighlight> is the prefix for all [[system name]]s, and also manages input from the console as well as output to the console. For that, it is a stylised console. <syntaxhighlight lang=apl inline>⍞</syntaxhighlight> looks like a <syntaxhighlight lang=apl inline>⎕</syntaxhighlight> with a quote <syntaxhighlight lang=apl inline>'</syntaxhighlight> indicating [[string]] input and message output.  
<  <syntaxhighlight lang=apl inline>⌈</syntaxhighlight> and <syntaxhighlight lang=apl inline>⌊</syntaxhighlight> are pictograms of a wall with a piece of [[ceiling]] and [[floor]], respectively.  
<  <syntaxhighlight lang=apl inline>⌈</syntaxhighlight> and <syntaxhighlight lang=apl inline>⌊</syntaxhighlight> can also be seen as indicators on a vertical number line, pointing at the [[maximum]] and [[minimum]], respectively.  
<  <syntaxhighlight lang=apl inline>∇</syntaxhighlight> is an upsidedown Greek [[Delta]], which corresponds to the letter ''D'' for [[Defined function]] or (own) definition (for recursion).  
<  <syntaxhighlight lang=apl inline>⌸</syntaxhighlight> ([[Key]]) applies a function for each collection of all elements that are [[equal]] (<syntaxhighlight lang=apl inline>⌸</syntaxhighlight>).  
<  <syntaxhighlight lang=apl inline>≡</syntaxhighlight> can be see as a stack of layers. When used monadically, it finds the [[depth]] of an array.  
<  <syntaxhighlight lang=apl inline>≢</syntaxhighlight> looks like a [[tally]] mark. It being sideways can be justified by it counting the length of the leading axis; the vertical axis of a matrix.  
<  <syntaxhighlight lang=apl inline>⊂</syntaxhighlight> [[enclose]]s its argument in a layer of nesting, and [[Disclose]] uses <syntaxhighlight lang=apl inline>⊃</syntaxhighlight> by analogy. <syntaxhighlight lang=apl inline>⊆</syntaxhighlight> is exactly like <syntaxhighlight lang=apl inline>⊂</syntaxhighlight> except that it only does a [[conditional enclose]], namely only if the argument is [[simple]].  
<  <syntaxhighlight lang=apl inline>⊂</syntaxhighlight> and <syntaxhighlight lang=apl inline>⊆</syntaxhighlight> enclose at specific locations, per a specification, so their dyadic forms are [[Partitioned enclose]] and [[Partition]], respectively.  
<  <syntaxhighlight lang=apl inline>∪</syntaxhighlight> is a styled letter ''U'' for [[Unique]] or [[Union]] if used dyadically.  
<  <syntaxhighlight lang=apl inline>⊥</syntaxhighlight> looks like the [[base]] of a pillar, converting from that base. [[Antibase]] uses <syntaxhighlight lang=apl inline>⊤</syntaxhighlight> by analogy, and looks a styled letter ''T'' for "To base". <syntaxhighlight lang=apl inline>⊤</syntaxhighlight> and <syntaxhighlight lang=apl inline>⊥</syntaxhighlight> are also respectively known as [[Encode]] and [[Decode]]. To remember which is which, <syntaxhighlight lang=apl inline>⊤</syntaxhighlight> looks like a styled letter ''T'', so think "Tencode".  
[[File:Lamp bulb.pngthumbThe [[Lamp]] glyph <  [[File:Lamp bulb.pngthumbThe [[Lamp]] glyph <syntaxhighlight lang=apl inline>⍝</syntaxhighlight> looks like a a lamp bulb filament.]]  
<  <syntaxhighlight lang=apl inline>⍝</syntaxhighlight> looks like a [[wikipedia:filament lampfilament lamp]] and provides enlightenment by indicating [[comment]]s.  
<  <syntaxhighlight lang=apl inline>,</syntaxhighlight> [[concatenate]]s arrays, much like the common punctuation symbol concatenates phrases. <syntaxhighlight lang=apl inline>⍪</syntaxhighlight> has an added styled row, indicating that for matrices, it concatenates additional rows.  
<  <syntaxhighlight lang=apl inline>.</syntaxhighlight> is just a low dot, but performs the same operation (though generalised) as [[traditional mathematics]]' [[wikipedia:dot productdot product]].  
<  <syntaxhighlight lang=apl inline>/</syntaxhighlight> and <syntaxhighlight lang=apl inline>⌿</syntaxhighlight> are also called "by" which can be remembered as reduce by.  
== Pairing glyphs/functionality with their keyboard locations ==  == Pairing glyphs/functionality with their keyboard locations ==  
The following mnemonics are for [[Dyalog APL]]'s US English keyboard layout, but can easily be adapted to similar layouts.  
=== Number row keys ===  
<syntaxhighlight lang=apl inline>⋄</syntaxhighlight> begins new APL expressions just like <kbd>`</kbd> button begins the main section of the keyboard. <syntaxhighlight lang=apl inline>⌺</syntaxhighlight> is a modified version of <syntaxhighlight lang=apl inline>⌺</syntaxhighlight>, so it is <kbd>Shift</kbd>+<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>.  
<syntaxhighlight lang=apl inline>¨</syntaxhighlight> applies a function to each 1 of the argument elements, so it is on <kbd>APL</kbd>+<kbd>1</kbd>. <syntaxhighlight lang=apl inline>⌶</syntaxhighlight> looks like a [[wikipedia:Roman numeralsRoman numeral]] 1, so it also lives on the <kbd>1</kbd>, albeit in the shifted position.  
<syntaxhighlight lang=apl inline>¯</syntaxhighlight>, <syntaxhighlight lang=apl inline><</syntaxhighlight>, <syntaxhighlight lang=apl inline>≤</syntaxhighlight>, <syntaxhighlight lang=apl inline>=</syntaxhighlight>, <syntaxhighlight lang=apl inline>≥</syntaxhighlight>, <syntaxhighlight lang=apl inline>></syntaxhighlight>, and <syntaxhighlight lang=apl inline>≠</syntaxhighlight> form a block. The number line 1–9 (because 0 on the far right) is split into two [[equal]] halves by <kbd>5</kbd> so that gives <syntaxhighlight lang=apl inline>=</syntaxhighlight>. <kbd>4</kbd> and <kbd>6</kbd> are slightly less and more, respectively, so they give <syntaxhighlight lang=apl inline>≤</syntaxhighlight> and <syntaxhighlight lang=apl inline>≥</syntaxhighlight>. <kbd>3</kbd> and <kbd>7</kbd> are much less and more, respectively, so they give <syntaxhighlight lang=apl inline><</syntaxhighlight> and <syntaxhighlight lang=apl inline>></syntaxhighlight>. Finally, <kbd>2</kbd> is so much less that it is negative, giving the negative sign <syntaxhighlight lang=apl inline>¯</syntaxhighlight>, and <kbd>8</kbd> is so much greater that it is completely [[not equalunequal]], <syntaxhighlight lang=apl inline>≠</syntaxhighlight>.  
<syntaxhighlight lang=apl inline>⍒</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍋</syntaxhighlight> are located on <kbd>#</kbd> (read "pound", <kbd>£</kbd> on British keyboards). <syntaxhighlight lang=apl inline>⍒</syntaxhighlight> pointing down is on the lower of the two numbers 3 and 4. This can be remembered as the pound going down due to [[wikipedia:BrexitBrexit]].  
<syntaxhighlight lang=apl inline>⌽</syntaxhighlight> mirrors an array over its vertical centre, so it is placed on the centre of the 1–9 number line. <syntaxhighlight lang=apl inline>⍉</syntaxhighlight> is slightly off centre, while <syntaxhighlight lang=apl inline>⊖</syntaxhighlight> has completely fallen over.  
<syntaxhighlight lang=apl inline>∨</syntaxhighlight> and <syntaxhighlight lang=apl inline>∧</syntaxhighlight> are on the largest (<kbd>9</kbd>) and smallest (<kbd>0</kbd>) digits, respectively, as <syntaxhighlight lang=apl inline>∨</syntaxhighlight> is inclusive (any argument being true gives true) while <syntaxhighlight lang=apl inline>∧</syntaxhighlight> is exclusive (any false gives false). Their negated versions <syntaxhighlight lang=apl inline>⍱</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍲</syntaxhighlight> are on the shifted positions.  
<syntaxhighlight lang=apl inline>×</syntaxhighlight> is adjacent to <syntaxhighlight lang=apl inline>∧</syntaxhighlight> for which it is equivalent on [[Boolean]] arguments. <syntaxhighlight lang=apl inline>!</syntaxhighlight> is above it, being <syntaxhighlight lang=apl inline>×/⍳</syntaxhighlight>. <syntaxhighlight lang=apl inline>÷</syntaxhighlight> is adjacent to its inverse, <syntaxhighlight lang=apl inline>×</syntaxhighlight>. And <syntaxhighlight lang=apl inline>⌹</syntaxhighlight> is in the shifted position, being the [[matrix]] equivalent of <syntaxhighlight lang=apl inline>÷</syntaxhighlight>.  
=== Top row keys ===  
<syntaxhighlight lang=apl inline>?</syntaxhighlight> is on <kbd>q</kbd> for '''''q'''uestion''.  
<syntaxhighlight lang=apl inline>⍵</syntaxhighlight>, <syntaxhighlight lang=apl inline>∊</syntaxhighlight>, and <syntaxhighlight lang=apl inline>⍳</syntaxhighlight> look similar to <kbd>w</kbd>, <kbd>e</kbd>, and <kbd>i</kbd>. <syntaxhighlight lang=apl inline>⍷</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍸</syntaxhighlight> are the shifted variants of <syntaxhighlight lang=apl inline>∊</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍳</syntaxhighlight>. The Greek letters <syntaxhighlight lang=apl inline>∊</syntaxhighlight>, and <syntaxhighlight lang=apl inline>⍳</syntaxhighlight> are also equivalent to the Latin ''e'', and ''i''.  
<syntaxhighlight lang=apl inline>⍴</syntaxhighlight> is the Greek equivalent of ''r''.  
<syntaxhighlight lang=apl inline>~</syntaxhighlight> is on <kbd>t</kbd> for its name '''''t'''ilde'', and its variant with diaeresis, <syntaxhighlight lang=apl inline>⍨</syntaxhighlight>, is on the shifted position.  
<syntaxhighlight lang=apl inline>↑</syntaxhighlight> is on <kbd>y</kbd> for '''''y'''ank'' (=take), and <syntaxhighlight lang=apl inline>↓</syntaxhighlight> is on the adjacent <kbd>u</kbd> for '''''drop''' down '''u'''nder''.  
<syntaxhighlight lang=apl inline>○</syntaxhighlight> is on <kbd>o</kbd> due to the similar looks, and <syntaxhighlight lang=apl inline>⍥</syntaxhighlight> is the shifted variant. <syntaxhighlight lang=apl inline>⍥</syntaxhighlight> is also on <kbd>O</kbd> for '''''O'''ver''.  
<syntaxhighlight lang=apl inline>*</syntaxhighlight> is on <kbd>p</kbd> for '''''p'''ower'', and <syntaxhighlight lang=apl inline>⍣</syntaxhighlight> is the shifted variant.  
<syntaxhighlight lang=apl inline>←</syntaxhighlight> and <syntaxhighlight lang=apl inline>→</syntaxhighlight> match the directionality of <kbd>[</kbd> and <kbd>]</kbd>. <syntaxhighlight lang=apl inline>⍞</syntaxhighlight> is usually immediately assigned to/from using <syntaxhighlight lang=apl inline>←</syntaxhighlight>, so they share key. <syntaxhighlight lang=apl inline>⍬</syntaxhighlight> is the empty vector and vectors are usually pictured as arrows pointing right, so it shares key with <syntaxhighlight lang=apl inline>→</syntaxhighlight>.  
<syntaxhighlight lang=apl inline>⊢</syntaxhighlight> is on the '''right'''most key, and its shifted variant <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> points the other way.  
=== Home row keys ===  
<syntaxhighlight lang=apl inline>⍺</syntaxhighlight> looks similar to <kbd>a</kbd>. The Greek letter <syntaxhighlight lang=apl inline>⍺</syntaxhighlight>is also equivalent to the Latin ''a''. Finally, <syntaxhighlight lang=apl inline>⍺</syntaxhighlight>, being the left argument, is (below and) to the left of the right argument <syntaxhighlight lang=apl inline>⍵</syntaxhighlight> on <kbd>w</kbd>.  
<syntaxhighlight lang=apl inline>⌈</syntaxhighlight> is on <kbd>s</kbd> for '''''s'''eiling'' (since ''c'' is pronounced like ''s'' here) and also finds the superlative argument. <syntaxhighlight lang=apl inline>⌊</syntaxhighlight> is adjacent on <kbd>d</kbd> for ''rounding '''d'''own''.  
<syntaxhighlight lang=apl inline>_</syntaxhighlight> is on <kbd>f</kbd> for being a '''''f'''loormat''.  
<syntaxhighlight lang=apl inline>∇</syntaxhighlight> is on <kbd>g</kbd> for '''''g'''o!'', indicating the beginning of a function definition or going around again (recursion). Adjecent, we find its upturned variant, <syntaxhighlight lang=apl inline>∆</syntaxhighlight>, which is a '''''h'''ome'' tent, located on on <kbd>h</kbd>.  
<syntaxhighlight lang=apl inline>∘</syntaxhighlight> on <kbd>j</kbd> is called '''''j'''ot''. Its variant with diaeresis, <syntaxhighlight lang=apl inline>⍤</syntaxhighlight>, is on the shifted position.  
<syntaxhighlight lang=apl inline>'</syntaxhighlight> is on <kbd>k</kbd> for '''''k'''uote'' (since ''q'' is reserved for ''question'', as in "Q&A").  
<syntaxhighlight lang=apl inline>⌸</syntaxhighlight> is also on <kbd>K</kbd> for '''''K'''ey''.  
<syntaxhighlight lang=apl inline>⎕</syntaxhighlight> is on <kbd>L</kbd> which looks like its lower left half. <syntaxhighlight lang=apl inline>⌷</syntaxhighlight> is its squished equivalent, on the shifted key.  
<syntaxhighlight lang=apl inline>⍎</syntaxhighlight> executes code, and is on <kbd>;</kbd> which is a ubiquitous symbol in code. Adjacent is <syntaxhighlight lang=apl inline>⍕</syntaxhighlight> which is its inverse and is found on <kbd>'</kbd> because it makes things into text, as indicated by the quote.  
<syntaxhighlight lang=apl inline>≡</syntaxhighlight> is on <kbd>:</kbd> — a stack of lines on a stack of dots. <syntaxhighlight lang=apl inline>≢</syntaxhighlight> is its negation and is found adjacent to it, on the <kbd>'</kbd> key, <syntaxhighlight lang=apl inline>≢</syntaxhighlight> being a <syntaxhighlight lang=apl inline>≡</syntaxhighlight> with a <code>'</code> drawn on top.  
=== Bottom row keys ===  
<syntaxhighlight lang=apl inline>⊂</syntaxhighlight> is on <kbd>z</kbd> because it '''''z'''ips'' up (encloses) a value into a scalar. Its shifted variant <syntaxhighlight lang=apl inline>⊆</syntaxhighlight> only does so conditionally. Its inverse and mirrorimage, <syntaxhighlight lang=apl inline>⊃</syntaxhighlight>, is located adjacent, on <kbd>x</kbd> because it ''e'''x'''tracts'' (discloses) the content of an enclosed scalar.  
<syntaxhighlight lang=apl inline>∩</syntaxhighlight> is on <kbd>c</kbd> for '''''c'''ap'', and its upturned variant, <syntaxhighlight lang=apl inline>∪</syntaxhighlight>, is adjacent on <kbd>v</kbd> to which it is visually similar.  
<syntaxhighlight lang=apl inline>⊥</syntaxhighlight> is on <kbd>b</kbd> because it evaluates digits in a given '''''b'''ase''. Its upturned variant <syntaxhighlight lang=apl inline>⊤</syntaxhighlight> is adjacent on <kbd>n</kbd> because it (''e'')'''''n'''code''s a normal '''''n'''umber'' to a custom '''''n'''umber'' system.  
<syntaxhighlight lang=apl inline></syntaxhighlight> is on <kbd>m</kbd> for '''''modulo''/'''''m'''agnitude'' and '''''modulus''.  
<syntaxhighlight lang=apl inline>⍝</syntaxhighlight> is on <kbd>,</kbd> due to the similarity of the words ''comma'' and ''comment''. Shifted <kbd>,</kbd> gives the barred version, <syntaxhighlight lang=apl inline>⍪</syntaxhighlight>.  
<syntaxhighlight lang=apl inline>⍀</syntaxhighlight> is adjacent to its mirrored counterpart <syntaxhighlight lang=apl inline>⌿</syntaxhighlight> which in turn is a barred version of its key, <kbd>/</kbd>.  
<syntaxhighlight lang=apl inline>⍠</syntaxhighlight> varies the meaning of its operand, so it is in the corner on <kbd>?</kbd>, adjacent to all the shifting keys.  
=== Summary ===  
All the above mnemonics are annotated on the below image of a US English keyboard layout:  
{{#css:.image img{width:100%;height:auto}}[[File:Keyboard Mnemonics.png]]  {{#css:.image img{width:100%;height:auto}}[[File:Keyboard Mnemonics.png]]  
<  == Pairing monadic and dyadic meanings ==  
<  Meaning pairings fall into three groups as follows.  
=== Monadic form is like dyadic form with a default left argument ===  
{ class=wikitable  
! Glyph  
! Default left argument  
  
 <syntaxhighlight lang=apl inline>+</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>0J¯2×11○x</syntaxhighlight> i.e. <math>2\!\cdot\!\Im(x)</math>  
  
 <syntaxhighlight lang=apl inline></syntaxhighlight>  
 0  
  
 <syntaxhighlight lang=apl inline>×</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>÷(x)+x=0</syntaxhighlight> i.e. <math>\frac1{x+[x=0]}</math>  
  
 <syntaxhighlight lang=apl inline>÷</syntaxhighlight>  
 1  
  
 <syntaxhighlight lang=apl inline>*</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>*1</syntaxhighlight> i.e. <math>e</math>  
  
 <syntaxhighlight lang=apl inline>⍟</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>*1</syntaxhighlight> i.e. <math>e</math>  
  
 <syntaxhighlight lang=apl inline>,</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>⍬</syntaxhighlight> (for scalars and vectors only)  
  
 <syntaxhighlight lang=apl inline>?</syntaxhighlight>  
 1 (almost; monadic form gives a scalar, dyadic form gives a vector)  
  
 <syntaxhighlight lang=apl inline>⍒</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>⎕UCS 0,⍳111411</syntaxhighlight>  
  
 <syntaxhighlight lang=apl inline>⍋</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>⎕UCS 0,⍳111411</syntaxhighlight>  
  
 <syntaxhighlight lang=apl inline>⍉</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>⌽⍳≢⍴x</syntaxhighlight>  
  
 <syntaxhighlight lang=apl inline>⍎</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>⎕THIS</syntaxhighlight>  
  
 <syntaxhighlight lang=apl inline>⌹</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>∘.=⍨⍳≢x</syntaxhighlight> i.e. <math>I_n</math>  
  
 <syntaxhighlight lang=apl inline>⊂</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>,1</syntaxhighlight> (almost; monadic form gives a scalar, dyadic form gives a vector)  
  
 <syntaxhighlight lang=apl inline>⊃</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>⊂(≢⍴x)⍴1</syntaxhighlight>  
  
 <syntaxhighlight lang=apl inline>∪</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>∪x</syntaxhighlight>  
  
 <syntaxhighlight lang=apl inline>⌷</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>⊂⍳≢⌷x</syntaxhighlight>  
  
 <syntaxhighlight lang=apl inline>⊣</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>x</syntaxhighlight>  
  
 <syntaxhighlight lang=apl inline>⊢</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>x</syntaxhighlight>  
}  
=== Both forms are good fit for the glyph ===  
{ class=wikitable  
! Glyph  
! Explanation  
  
 <syntaxhighlight lang=apl inline>≡</syntaxhighlight>  
 indicates (3) layers of depth for the monadic form  
  
 <syntaxhighlight lang=apl inline>≢</syntaxhighlight>  
 indicates a counting rod marking for the monadic form  
  
 <syntaxhighlight lang=apl inline>↑</syntaxhighlight>  
 take elements and increase rank  
  
 <syntaxhighlight lang=apl inline>↓</syntaxhighlight>  
 drop elements and decrease rank  
  
 <syntaxhighlight lang=apl inline>∊</syntaxhighlight>  
 "'''e'''lement of" and "'''e'''nlist"  
  
 <syntaxhighlight lang=apl inline>⊆</syntaxhighlight>  
 "enclose at positions where condition is met" and "enclose on condition of being simple"  
  
 <syntaxhighlight lang=apl inline>⍸</syntaxhighlight>  
 "'''i'''ndices where elements fit into intervals" and "'''i'''ndices where true"  
  
 <syntaxhighlight lang=apl inline>⍪</syntaxhighlight>  
 <syntaxhighlight lang=apl inline>,[1]x</syntaxhighlight> (for nonscalars) and <syntaxhighlight lang=apl inline>,⍤¯1</syntaxhighlight> (for higherrank arrays)  
}  
=== The two forms are conceptually related ===  
<  { class=wikitable  
! Glyph  
! Relationship  
  
 <syntaxhighlight lang=apl inline>⌈</syntaxhighlight>  
 next higher integer or highest argument  
  
 <syntaxhighlight lang=apl inline>⌊</syntaxhighlight>  
 next lower integer or lowest argument  
  
 <syntaxhighlight lang=apl inline></syntaxhighlight>  
 both forms can be called [[wikipedia:modulomodulo]] and use the symbol: <math>x</math> and <math>ab</math>  
  
 <syntaxhighlight lang=apl inline>!</syntaxhighlight>  
 factorial is prominent in the formula for binomial  
  
 <syntaxhighlight lang=apl inline>○</syntaxhighlight>  
 both the trigonometric functions and <math>\pi</math> relate to the (unit) circle  
  
 <syntaxhighlight lang=apl inline>~</syntaxhighlight>  
 "not" and "but not"  
  
 <syntaxhighlight lang=apl inline>≠</syntaxhighlight>  
 monadic means "not equal to any preceding item"  
  
 <syntaxhighlight lang=apl inline>⍴</syntaxhighlight>  
 shape and reshape  
  
 <syntaxhighlight lang=apl inline>⍳</syntaxhighlight>  
 indices of and index of  
  
 <syntaxhighlight lang=apl inline>⌽</syntaxhighlight>  
 rotate and mirror along last axis  
  
 <syntaxhighlight lang=apl inline>⊖</syntaxhighlight>  
 rotate and mirror along first axis  
  
 <syntaxhighlight lang=apl inline>⍕</syntaxhighlight>  
 format and format with specification  
}  
{{APL development}}{{APL glyphs}}  {{APL development}}{{APL glyphs}}  
[[Category:APL character set]]  [[Category:APL character set]] 
Latest revision as of 08:54, 3 August 2023
Mnemonics can assist with learning the meaning of APL glyphs and where on they keyboard they are found for typing them. Both of these skills are essential for an effective APL programmer. This article provides such aidemémoires.
Pairing glyphs with their meaning
Many glyphs have meaning identical to their mathematical counterparts.
⋄
(Diamond) separates statements. That is, no functions or operators can break through ⋄
, just as diamonds are virtually indestructible.
⌺
looks like a ⋄
shaped Stencil laid on a piece of paper, ⎕
.
!
is Binomial in addition to Factorial, as the two are closely related.
⌶
(Ibeam) calls system services. APL was originally developed at IBM, so system services were also IBM services. ⌶
is an Ibeam and Ibeam is pronounced almost identically to IBM.
@
applies a function or substitutes elements at specific locations.
⍋
and ⍒
give the indices (grades) needed to sort ascending and descending respectively, and look like an ascending and descending supersonic transport, respectively.
⌽
, ⊖
, and ⍉
reverse or transpose an array over a given axis. The ○
part of the glyphs symbolise the array, while the line component (
, \
, or 
) indicates the line across which the reversal/transposal is done.
⍟
looks like the crosssection of a tree log
⍱
and ⍲
(Nor and Nand) have the Not glyph ~
on top of or overlaid on the Or glyph ∨
and And glyph ∧
respectively.
×
can be seen as an when monadic, indicating the unknown sign to be determined.
+
negates the imaginary part (that is, it conjugates) by analogy to monadic 
which negates both the real and the imaginary parts.
÷
takes a default left argument of 1
(thus computing the reciprocal), that being the identity element of division.
⌹
is matrix divide with a ⎕
symbolising a matrix and an inscribed ÷
for "divide".
?
symbolises the unknown, and thus rolls dice and deals cards randomly.
⍺
and ⍵
are the leftmost and rightmost letters of the Greek alphabet. They therefore denote the left and right arguments of dfns, respectively.
∊
is the Greek letter Epsilon which corresponds to the letter E for Enlist and Element of.
⍴
is the Greek letter Rho which corresponds to the letter R for Reshape.
~
is Not when monadic, but its dyadic form, Without, can also be remembered as but not.
⍨
is a monadic operator that looks like a face. When its derived function is applied monadically, it can be called selfie, in that it applies the operand function to the argument with the argument itself as left argument too.
↑
and ↓
(Mix and Split) increase and decrease rank (if possible) when used monadically.
↓
drops elements, and so it points down, the direction in which things are dropped. Take uses ↑
by analogy.
⍳
is the Greek letter Iota which corresponds to the letter I for Index generator and Index of.
⍸
is also the Greek letter Iota which corresponds to the letter I for Indices and Interval Index.
○
is a circle for Circular functions and the ratio between the circumference and the diameter of a circle, Pi.
⍥
and ⍤
(Over and Atop) both apply the left operand after the right operand. However, ⍥
has a larger "circle of influence" in that it applies its right operand twice (once on each argument) while ⍤
only applies it once (between the arguments).
*
and ⍣
repeatedly apply multiplication and a function, respectively. The star symbolises power (function)/power (operator).
←
assigns by putting the value on its right into the name on its left.
→
points at the destination it is branching to.
⍬
(Zilde) is a combination of ~
for Without and 0
indicating numbers. Indeed, it is the "vector without numbers", equivalent to 0~0
.
⊣
and ⊢
point a finger towards the left and right, which are exactly the argument they, respectively, return.
⎕
is the prefix for all system names, and also manages input from the console as well as output to the console. For that, it is a stylised console. ⍞
looks like a ⎕
with a quote '
indicating string input and message output.
⌈
and ⌊
are pictograms of a wall with a piece of ceiling and floor, respectively.
⌈
and ⌊
can also be seen as indicators on a vertical number line, pointing at the maximum and minimum, respectively.
∇
is an upsidedown Greek Delta, which corresponds to the letter D for Defined function or (own) definition (for recursion).
⌸
(Key) applies a function for each collection of all elements that are equal (⌸
).
≡
can be see as a stack of layers. When used monadically, it finds the depth of an array.
≢
looks like a tally mark. It being sideways can be justified by it counting the length of the leading axis; the vertical axis of a matrix.
⊂
encloses its argument in a layer of nesting, and Disclose uses ⊃
by analogy. ⊆
is exactly like ⊂
except that it only does a conditional enclose, namely only if the argument is simple.
⊂
and ⊆
enclose at specific locations, per a specification, so their dyadic forms are Partitioned enclose and Partition, respectively.
∪
is a styled letter U for Unique or Union if used dyadically.
⊥
looks like the base of a pillar, converting from that base. Antibase uses ⊤
by analogy, and looks a styled letter T for "To base". ⊤
and ⊥
are also respectively known as Encode and Decode. To remember which is which, ⊤
looks like a styled letter T, so think "Tencode".
⍝
looks like a filament lamp and provides enlightenment by indicating comments.
,
concatenates arrays, much like the common punctuation symbol concatenates phrases. ⍪
has an added styled row, indicating that for matrices, it concatenates additional rows.
.
is just a low dot, but performs the same operation (though generalised) as traditional mathematics' dot product.
/
and ⌿
are also called "by" which can be remembered as reduce by.
Pairing glyphs/functionality with their keyboard locations
The following mnemonics are for Dyalog APL's US English keyboard layout, but can easily be adapted to similar layouts.
Number row keys
⋄
begins new APL expressions just like ` button begins the main section of the keyboard. ⌺
is a modified version of ⌺
, so it is Shift+⋄
.
¨
applies a function to each 1 of the argument elements, so it is on APL+1. ⌶
looks like a Roman numeral 1, so it also lives on the 1, albeit in the shifted position.
¯
, <
, ≤
, =
, ≥
, >
, and ≠
form a block. The number line 1–9 (because 0 on the far right) is split into two equal halves by 5 so that gives =
. 4 and 6 are slightly less and more, respectively, so they give ≤
and ≥
. 3 and 7 are much less and more, respectively, so they give <
and >
. Finally, 2 is so much less that it is negative, giving the negative sign ¯
, and 8 is so much greater that it is completely unequal, ≠
.
⍒
and ⍋
are located on # (read "pound", £ on British keyboards). ⍒
pointing down is on the lower of the two numbers 3 and 4. This can be remembered as the pound going down due to Brexit.
⌽
mirrors an array over its vertical centre, so it is placed on the centre of the 1–9 number line. ⍉
is slightly off centre, while ⊖
has completely fallen over.
∨
and ∧
are on the largest (9) and smallest (0) digits, respectively, as ∨
is inclusive (any argument being true gives true) while ∧
is exclusive (any false gives false). Their negated versions ⍱
and ⍲
are on the shifted positions.
×
is adjacent to ∧
for which it is equivalent on Boolean arguments. !
is above it, being ×/⍳
. ÷
is adjacent to its inverse, ×
. And ⌹
is in the shifted position, being the matrix equivalent of ÷
.
Top row keys
?
is on q for question.
⍵
, ∊
, and ⍳
look similar to w, e, and i. ⍷
and ⍸
are the shifted variants of ∊
and ⍳
. The Greek letters ∊
, and ⍳
are also equivalent to the Latin e, and i.
⍴
is the Greek equivalent of r.
~
is on t for its name tilde, and its variant with diaeresis, ⍨
, is on the shifted position.
↑
is on y for yank (=take), and ↓
is on the adjacent u for drop down under.
○
is on o due to the similar looks, and ⍥
is the shifted variant. ⍥
is also on O for Over.
*
is on p for power, and ⍣
is the shifted variant.
←
and →
match the directionality of [ and ]. ⍞
is usually immediately assigned to/from using ←
, so they share key. ⍬
is the empty vector and vectors are usually pictured as arrows pointing right, so it shares key with →
.
⊢
is on the rightmost key, and its shifted variant ⊣
points the other way.
Home row keys
⍺
looks similar to a. The Greek letter ⍺
is also equivalent to the Latin a. Finally, ⍺
, being the left argument, is (below and) to the left of the right argument ⍵
on w.
⌈
is on s for seiling (since c is pronounced like s here) and also finds the superlative argument. ⌊
is adjacent on d for rounding down.
_
is on f for being a floormat.
∇
is on g for go!, indicating the beginning of a function definition or going around again (recursion). Adjecent, we find its upturned variant, ∆
, which is a home tent, located on on h.
∘
on j is called jot. Its variant with diaeresis, ⍤
, is on the shifted position.
'
is on k for kuote (since q is reserved for question, as in "Q&A").
⌸
is also on K for Key.
⎕
is on L which looks like its lower left half. ⌷
is its squished equivalent, on the shifted key.
⍎
executes code, and is on ; which is a ubiquitous symbol in code. Adjacent is ⍕
which is its inverse and is found on ' because it makes things into text, as indicated by the quote.
≡
is on : — a stack of lines on a stack of dots. ≢
is its negation and is found adjacent to it, on the ' key, ≢
being a ≡
with a '
drawn on top.
Bottom row keys
⊂
is on z because it zips up (encloses) a value into a scalar. Its shifted variant ⊆
only does so conditionally. Its inverse and mirrorimage, ⊃
, is located adjacent, on x because it extracts (discloses) the content of an enclosed scalar.
∩
is on c for cap, and its upturned variant, ∪
, is adjacent on v to which it is visually similar.
⊥
is on b because it evaluates digits in a given base. Its upturned variant ⊤
is adjacent on n because it (e)ncodes a normal number to a custom number system.

is on m for modulo/magnitude and modulus.
⍝
is on , due to the similarity of the words comma and comment. Shifted , gives the barred version, ⍪
.
⍀
is adjacent to its mirrored counterpart ⌿
which in turn is a barred version of its key, /.
⍠
varies the meaning of its operand, so it is in the corner on ?, adjacent to all the shifting keys.
Summary
All the above mnemonics are annotated on the below image of a US English keyboard layout:
Pairing monadic and dyadic meanings
Meaning pairings fall into three groups as follows.
Monadic form is like dyadic form with a default left argument
Glyph  Default left argument 

+

0J¯2×11○x i.e.



0 
×

÷(x)+x=0 i.e.

÷

1 
*

*1 i.e.

⍟

*1 i.e.

,

⍬ (for scalars and vectors only)

?

1 (almost; monadic form gives a scalar, dyadic form gives a vector) 
⍒

⎕UCS 0,⍳111411

⍋

⎕UCS 0,⍳111411

⍉

⌽⍳≢⍴x

⍎

⎕THIS

⌹

∘.=⍨⍳≢x i.e.

⊂

,1 (almost; monadic form gives a scalar, dyadic form gives a vector)

⊃

⊂(≢⍴x)⍴1

∪

∪x

⌷

⊂⍳≢⌷x

⊣

x

⊢

x

Both forms are good fit for the glyph
Glyph  Explanation 

≡

indicates (3) layers of depth for the monadic form 
≢

indicates a counting rod marking for the monadic form 
↑

take elements and increase rank 
↓

drop elements and decrease rank 
∊

"element of" and "enlist" 
⊆

"enclose at positions where condition is met" and "enclose on condition of being simple" 
⍸

"indices where elements fit into intervals" and "indices where true" 
⍪

,[1]x (for nonscalars) and ,⍤¯1 (for higherrank arrays)

Glyph  Relationship 

⌈

next higher integer or highest argument 
⌊

next lower integer or lowest argument 


both forms can be called modulo and use the symbol: and 
!

factorial is prominent in the formula for binomial 
○

both the trigonometric functions and relate to the (unit) circle 
~

"not" and "but not" 
≠

monadic means "not equal to any preceding item" 
⍴

shape and reshape 
⍳

indices of and index of 
⌽

rotate and mirror along last axis 
⊖

rotate and mirror along first axis 
⍕

format and format with specification 
APL development [edit]  

Interface  Session ∙ Typing glyphs (on Linux) ∙ Fonts ∙ Text editors 
Publications  Introductions ∙ Learning resources ∙ Simple examples ∙ Advanced examples ∙ Mnemonics ∙ Standards ∙ A Dictionary of APL ∙ Case studies ∙ Documentation suites ∙ Books ∙ Papers ∙ Videos ∙ Periodicals ∙ Terminology (Chinese, German) ∙ Neural networks ∙ Error trapping with Dyalog APL (in forms) 
Sharing code  Backwards compatibility ∙ APLcart ∙ APLTree ∙ APLCation ∙ Dfns workspace ∙ Tatin ∙ Cider 
Implementation  Developers (APL2000, Dyalog, GNU APL community, IBM, IPSA, STSC) ∙ Resources ∙ Opensource ∙ Magic function ∙ Performance ∙ APL hardware 
APL glyphs [edit]  

Information  Glyph ∙ Typing glyphs (on Linux) ∙ Unicode ∙ Fonts ∙ Mnemonics ∙ Overstrikes ∙ Migration level 
Individual glyphs  Jot (∘ ) ∙ Right Shoe (⊃ ) ∙ Up Arrow (↑ ) ∙ Zilde (⍬ ) ∙ High minus (¯ ) ∙ Dot (. ) ∙ Del (∇ )
