Mnemonics: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
m (Remove duplicate word)
m (Text replacement - "</source>" to "</syntaxhighlight>")
Line 5: Line 5:
Many glyphs have meaning [[Comparison_with_traditional_mathematics#Identical|identical to their mathematical counterparts]].
Many glyphs have meaning [[Comparison_with_traditional_mathematics#Identical|identical to their mathematical counterparts]].


<source lang=apl inline>⋄</source> (Diamond) separates statements. That is, no functions or operators can break through <source lang=apl inline>⋄</source>, just as diamonds are virtually indestructible.
<source lang=apl inline>⋄</syntaxhighlight> (Diamond) separates statements. That is, no functions or operators can break through <source lang=apl inline>⋄</syntaxhighlight>, just as diamonds are virtually indestructible.


<source lang=apl inline>⌺</source> looks like a <source lang=apl inline>⋄</source>-shaped [[Stencil]] laid on a piece of paper, <source lang=apl inline>⎕</source>.
<source lang=apl inline>⌺</syntaxhighlight> looks like a <source lang=apl inline>⋄</syntaxhighlight>-shaped [[Stencil]] laid on a piece of paper, <source lang=apl inline>⎕</syntaxhighlight>.


<source lang=apl inline>!</source> is [[Binomial]] in addition to [[Factorial]], as the two are closely related.
<source lang=apl inline>!</syntaxhighlight> is [[Binomial]] in addition to [[Factorial]], as the two are closely related.


[[File:I beam HEB 100.png|thumb|[[I-beam]] <source lang=apl inline>⌶</source> does look like an [[wikipedia:I-beam|I-beam]]]]
[[File:I beam HEB 100.png|thumb|[[I-beam]] <source lang=apl inline>⌶</syntaxhighlight> does look like an [[wikipedia:I-beam|I-beam]]]]
<source lang=apl inline>⌶</source> ([[I-beam]]) calls system services. APL was originally developed at [[IBM]], so system services were also IBM services. <source lang=apl inline>⌶</source> is an [[wikipedia:I-beam|I-beam]] and ''I-beam'' is pronounced almost identically to ''IBM''.
<source lang=apl inline>⌶</syntaxhighlight> ([[I-beam]]) calls system services. APL was originally developed at [[IBM]], so system services were also IBM services. <source lang=apl inline>⌶</syntaxhighlight> is an [[wikipedia:I-beam|I-beam]] and ''I-beam'' is pronounced almost identically to ''IBM''.


<source lang=apl inline>@</source> applies a function or substitutes elements ''[[at]]'' specific locations.
<source lang=apl inline>@</syntaxhighlight> applies a function or substitutes elements ''[[at]]'' specific locations.


[[File:Bristol Type 223 top-view silhouette.png|thumb|The [[Grade]] glyphs <source lang=apl inline>⍋</source> and <source lang=apl inline>⍒</source> look like [[wikipedia:supersonic transport|supersonic transport]]s.]]
[[File:Bristol Type 223 top-view silhouette.png|thumb|The [[Grade]] glyphs <source lang=apl inline>⍋</syntaxhighlight> and <source lang=apl inline>⍒</syntaxhighlight> look like [[wikipedia:supersonic transport|supersonic transport]]s.]]
<source lang=apl inline>⍋</source> and <source lang=apl inline>⍒</source> give the indices ([[grade]]s) needed to sort ascending and descending respectively, and look like an ascending and descending supersonic transport, respectively.
<source lang=apl inline>⍋</syntaxhighlight> and <source 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.


<source lang=apl inline>⌽</source>, <source lang=apl inline>⊖</source>, and <source lang=apl inline>⍉</source> [[reverse]] or [[transpose]] an array over a given [[axis]]. The <source lang=apl inline>○</source> part of the glyphs symbolise the array, while the line component (<source lang=apl inline>|</source>, <source lang=apl inline>\</source>, or <source lang=apl inline>-</source>) indicates the line across which the reversal/transposal is done.
<source lang=apl inline>⌽</syntaxhighlight>, <source lang=apl inline>⊖</syntaxhighlight>, and <source lang=apl inline>⍉</syntaxhighlight> [[reverse]] or [[transpose]] an array over a given [[axis]]. The <source lang=apl inline>○</syntaxhighlight> part of the glyphs symbolise the array, while the line component (<source lang=apl inline>|</syntaxhighlight>, <source lang=apl inline>\</syntaxhighlight>, or <source lang=apl inline>-</syntaxhighlight>) indicates the line across which the reversal/transposal is done.


[[File:TreeLog.jpg|thumb|The [[Log]] glyph <source lang=apl inline>⍟</source> looks like a tree log.]]
[[File:TreeLog.jpg|thumb|The [[Log]] glyph <source lang=apl inline>⍟</syntaxhighlight> looks like a tree log.]]
<source lang=apl inline>⍟</source> looks like the cross-section of a tree [[log]]
<source lang=apl inline>⍟</syntaxhighlight> looks like the cross-section of a tree [[log]]


<source lang=apl inline>⍱</source> and <source lang=apl inline>⍲</source> ([[Nor]] and [[Nand]]) have the [[Not]] glyph <source lang=apl inline>~</source> on top of or overlaid on the [[Or]] glyph <source lang=apl inline>∨</source> and [[And]] glyph <source lang=apl inline>∧</source> respectively.
<source lang=apl inline>⍱</syntaxhighlight> and <source lang=apl inline>⍲</syntaxhighlight> ([[Nor]] and [[Nand]]) have the [[Not]] glyph <source lang=apl inline>~</syntaxhighlight> on top of or overlaid on the [[Or]] glyph <source lang=apl inline>∨</syntaxhighlight> and [[And]] glyph <source lang=apl inline>∧</syntaxhighlight> respectively.


<source lang=apl inline>×</source> can be seen as an <math>x</math> when monadic, indicating the unknown [[sign]] to be determined.
<source lang=apl inline>×</syntaxhighlight> can be seen as an <math>x</math> when monadic, indicating the unknown [[sign]] to be determined.


<source lang=apl inline>+</source> negates the imaginary part (that is, it [[conjugate]]s) by analogy to monadic <source lang=apl inline>-</source> which negates both the real and the imaginary parts.
<source lang=apl inline>+</syntaxhighlight> negates the imaginary part (that is, it [[conjugate]]s) by analogy to monadic <source lang=apl inline>-</syntaxhighlight> which negates both the real and the imaginary parts.


<source lang=apl inline>÷</source> takes a default left argument of <source lang=apl inline>1</source> (thus computing the [[reciprocal]]), that being the [[identity element]] of [[division]].
<source lang=apl inline>÷</syntaxhighlight> takes a default left argument of <source lang=apl inline>1</syntaxhighlight> (thus computing the [[reciprocal]]), that being the [[identity element]] of [[division]].


<source lang=apl inline>⌹</source> is [[matrix divide]] with a <source lang=apl inline>⎕</source> symbolising a matrix and an inscribed <source lang=apl inline>÷</source> for "divide".
<source lang=apl inline>⌹</syntaxhighlight> is [[matrix divide]] with a <source lang=apl inline>⎕</syntaxhighlight> symbolising a matrix and an inscribed <source lang=apl inline>÷</syntaxhighlight> for "divide".


<source lang=apl inline>?</source> symbolises the unknown, and thus [[roll]]s dice and [[deal]]s cards randomly.
<source lang=apl inline>?</syntaxhighlight> symbolises the unknown, and thus [[roll]]s dice and [[deal]]s cards randomly.


<source lang=apl inline>⍺</source> and <source lang=apl inline>⍵</source> are the leftmost and rightmost letters of the [[wikipedia:Greek alphabet|Greek alphabet]]. They therefore denote the left and right arguments of [[dfn]]s, respectively.
<source lang=apl inline>⍺</syntaxhighlight> and <source lang=apl inline>⍵</syntaxhighlight> are the leftmost and rightmost letters of the [[wikipedia:Greek alphabet|Greek alphabet]]. They therefore denote the left and right arguments of [[dfn]]s, respectively.


<source lang=apl inline>∊</source> is the Greek letter [[Epsilon]] which corresponds to the letter ''E'' for [[Enlist]] and [[Element of]].
<source lang=apl inline>∊</syntaxhighlight> is the Greek letter [[Epsilon]] which corresponds to the letter ''E'' for [[Enlist]] and [[Element of]].


<source lang=apl inline>⍴</source> is the Greek letter [[Rho]] which corresponds to the letter ''R'' for [[Reshape]].
<source lang=apl inline>⍴</syntaxhighlight> is the Greek letter [[Rho]] which corresponds to the letter ''R'' for [[Reshape]].


<source lang=apl inline>~</source> is [[Not]] when monadic, but its dyadic form, [[Without]], can also be remembered as ''but not''.
<source lang=apl inline>~</syntaxhighlight> is [[Not]] when monadic, but its dyadic form, [[Without]], can also be remembered as ''but not''.


<source lang=apl inline>⍨</source> 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.
<source 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.


<source lang=apl inline>↑</source> and <source lang=apl inline>↓</source> ([[Mix]] and [[Split]]) increase and decrease rank (if possible) when used monadically.
<source lang=apl inline>↑</syntaxhighlight> and <source lang=apl inline>↓</syntaxhighlight> ([[Mix]] and [[Split]]) increase and decrease rank (if possible) when used monadically.


<source lang=apl inline>↓</source> [[drop]]s elements, and so it points down, the direction in which things are dropped. Take uses <source lang=apl inline>↑</source> by analogy.
<source lang=apl inline>↓</syntaxhighlight> [[drop]]s elements, and so it points down, the direction in which things are dropped. Take uses <source lang=apl inline>↑</syntaxhighlight> by analogy.


<source lang=apl inline>⍳</source> is the Greek letter [[Iota]] which corresponds to the letter ''I'' for [[Index generator]] and [[Index of]].
<source lang=apl inline>⍳</syntaxhighlight> is the Greek letter [[Iota]] which corresponds to the letter ''I'' for [[Index generator]] and [[Index of]].


<source lang=apl inline>⍸</source> is also the Greek letter [[Iota]] which corresponds to the letter ''I'' for [[Indices]] and [[Interval Index]].
<source lang=apl inline>⍸</syntaxhighlight> is also the Greek letter [[Iota]] which corresponds to the letter ''I'' for [[Indices]] and [[Interval Index]].


<source lang=apl inline>○</source> is a circle for [[Circular]] functions and the ratio between the circumference and the diameter of a circle, [[Pi times|Pi]].
<source lang=apl inline>○</syntaxhighlight> is a circle for [[Circular]] functions and the ratio between the circumference and the diameter of a circle, [[Pi times|Pi]].


<source lang=apl inline>⍥</source> and <source lang=apl inline>⍤</source> ([[Over]] and [[Atop]]) both apply the left operand after the right operand. However, <source lang=apl inline>⍥</source> has a larger "circle of influence" in that it applies its right operand twice (once on each argument) while <source lang=apl inline>⍤</source> only applies it once (between the arguments).
<source lang=apl inline>⍥</syntaxhighlight> and <source lang=apl inline>⍤</syntaxhighlight> ([[Over]] and [[Atop]]) both apply the left operand after the right operand. However, <source lang=apl inline>⍥</syntaxhighlight> has a larger "circle of influence" in that it applies its right operand twice (once on each argument) while <source lang=apl inline>⍤</syntaxhighlight> only applies it once (between the arguments).


<source lang=apl inline>*</source> and <source lang=apl inline>⍣</source> repeatedly apply multiplication and a function, respectively. The star symbolises [[power (function)]]/[[power (operator)]].
<source lang=apl inline>*</syntaxhighlight> and <source lang=apl inline>⍣</syntaxhighlight> repeatedly apply multiplication and a function, respectively. The star symbolises [[power (function)]]/[[power (operator)]].


<source lang=apl inline>←</source> [[assign]]s by putting the value on its right into the name on its left.
<source lang=apl inline>←</syntaxhighlight> [[assign]]s by putting the value on its right into the name on its left.


<source lang=apl inline>→</source> points at the destination it is [[branch]]ing to.
<source lang=apl inline>→</syntaxhighlight> points at the destination it is [[branch]]ing to.


<source lang=apl inline>⍬</source> ([[Zilde]]) is a combination of <source lang=apl inline>~</source> for [[Without]] and <source lang=apl inline>0</source> indicating numbers. Indeed, it is the "vector without numbers", equivalent to <source lang=apl inline>0~0</source>.
<source lang=apl inline>⍬</syntaxhighlight> ([[Zilde]]) is a combination of <source lang=apl inline>~</syntaxhighlight> for [[Without]] and <source lang=apl inline>0</syntaxhighlight> indicating numbers. Indeed, it is the "vector without numbers", equivalent to <source lang=apl inline>0~0</syntaxhighlight>.


<source lang=apl inline>⊣</source> and <source lang=apl inline>⊢</source> point a finger towards the [[left]] and [[right]], which are exactly the argument they, respectively, return.
<source lang=apl inline>⊣</syntaxhighlight> and <source lang=apl inline>⊢</syntaxhighlight> point a finger towards the [[left]] and [[right]], which are exactly the argument they, respectively, return.


[[File:Computer console.jpg|thumb|The [[Quad]] glyph <source lang=apl inline>⎕</source> looks like a console.]]
[[File:Computer console.jpg|thumb|The [[Quad]] glyph <source lang=apl inline>⎕</syntaxhighlight> looks like a console.]]
<source lang=apl inline>⎕</source> 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. <source lang=apl inline>⍞</source> looks like a <source lang=apl inline>⎕</source> with a quote <source lang=apl inline>'</source> indicating [[string]] input and message output.
<source 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. <source lang=apl inline>⍞</syntaxhighlight> looks like a <source lang=apl inline>⎕</syntaxhighlight> with a quote <source lang=apl inline>'</syntaxhighlight> indicating [[string]] input and message output.


<source lang=apl inline>⌈</source> and <source lang=apl inline>⌊</source> are pictograms of a wall with a piece of [[ceiling]] and [[floor]], respectively.
<source lang=apl inline>⌈</syntaxhighlight> and <source lang=apl inline>⌊</syntaxhighlight> are pictograms of a wall with a piece of [[ceiling]] and [[floor]], respectively.


<source lang=apl inline>⌈</source> and <source lang=apl inline>⌊</source> can also be seen as indicators on a vertical number line, pointing at the [[maximum]] and [[minimum]], respectively.
<source lang=apl inline>⌈</syntaxhighlight> and <source lang=apl inline>⌊</syntaxhighlight> can also be seen as indicators on a vertical number line, pointing at the [[maximum]] and [[minimum]], respectively.


<source lang=apl inline>∇</source> is an upside-down Greek [[Delta]], which corresponds to the letter ''D'' for [[Defined function]] or (own) definition (for recursion).
<source lang=apl inline>∇</syntaxhighlight> is an upside-down Greek [[Delta]], which corresponds to the letter ''D'' for [[Defined function]] or (own) definition (for recursion).


<source lang=apl inline>⌸</source> ([[Key]]) applies a function for each collection of all elements that are [[equal]] (<source lang=apl inline>⌸</source>).
<source lang=apl inline>⌸</syntaxhighlight> ([[Key]]) applies a function for each collection of all elements that are [[equal]] (<source lang=apl inline>⌸</syntaxhighlight>).


<source lang=apl inline>≡</source> can be see as a stack of layers. When used monadically, it finds the [[depth]] of an array.
<source lang=apl inline>≡</syntaxhighlight> can be see as a stack of layers. When used monadically, it finds the [[depth]] of an array.


<source lang=apl inline>≢</source> 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.
<source 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.


<source lang=apl inline>⊂</source> [[enclose]]s its argument in a layer of nesting, and [[Disclose]] uses <source lang=apl inline>⊃</source> by analogy. <source lang=apl inline>⊆</source> is exactly like <source lang=apl inline>⊂</source> except that it only does a [[conditional enclose]], namely only if the argument is [[simple]].
<source lang=apl inline>⊂</syntaxhighlight> [[enclose]]s its argument in a layer of nesting, and [[Disclose]] uses <source lang=apl inline>⊃</syntaxhighlight> by analogy. <source lang=apl inline>⊆</syntaxhighlight> is exactly like <source lang=apl inline>⊂</syntaxhighlight> except that it only does a [[conditional enclose]], namely only if the argument is [[simple]].


<source lang=apl inline>⊂</source> and <source lang=apl inline>⊆</source> enclose at specific locations, per a specification, so their dyadic forms are [[Partitioned enclose]] and [[Partition]], respectively.
<source lang=apl inline>⊂</syntaxhighlight> and <source lang=apl inline>⊆</syntaxhighlight> enclose at specific locations, per a specification, so their dyadic forms are [[Partitioned enclose]] and [[Partition]], respectively.


<source lang=apl inline>∪</source> is a styled letter ''U'' for [[Unique]] or [[Union]] if used dyadically.
<source lang=apl inline>∪</syntaxhighlight> is a styled letter ''U'' for [[Unique]] or [[Union]] if used dyadically.


<source lang=apl inline>⊥</source> looks like the [[base]] of a pillar. [[Antibase]] uses <source lang=apl inline>⊤</source> by analogy.
<source lang=apl inline>⊥</syntaxhighlight> looks like the [[base]] of a pillar. [[Antibase]] uses <source lang=apl inline>⊤</syntaxhighlight> by analogy.


[[File:Lamp bulb.png|thumb|The [[Lamp]] glyph <source lang=apl inline>⍝</source> looks like a a lamp bulb filament.]]
[[File:Lamp bulb.png|thumb|The [[Lamp]] glyph <source lang=apl inline>⍝</syntaxhighlight> looks like a a lamp bulb filament.]]
<source lang=apl inline>⍝</source> looks like a [[wikipedia:filament lamp|filament lamp]] and provides enlightenment by indicating [[comment]]s.
<source lang=apl inline>⍝</syntaxhighlight> looks like a [[wikipedia:filament lamp|filament lamp]] and provides enlightenment by indicating [[comment]]s.


<source lang=apl inline>,</source> [[concatenate]]s arrays, much like the common punctuation symbol concatenates phrases. <source lang=apl inline>⍪</source> has an added styled row, indicating that for matrices, it concatenates additional rows.
<source lang=apl inline>,</syntaxhighlight> [[concatenate]]s arrays, much like the common punctuation symbol concatenates phrases. <source lang=apl inline>⍪</syntaxhighlight> has an added styled row, indicating that for matrices, it concatenates additional rows.


<source lang=apl inline>.</source> is just a low dot, but performs the same operation (though generalised) as [[traditional mathematics]]' [[wikipedia:dot product|dot product]].
<source lang=apl inline>.</syntaxhighlight> is just a low dot, but performs the same operation (though generalised) as [[traditional mathematics]]' [[wikipedia:dot product|dot product]].


<source lang=apl inline>/</source> and <source lang=apl inline>⌿</source> are also called "by" which can be remembered as reduce by.
<source lang=apl inline>/</syntaxhighlight> and <source 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.
The following mnemonics are for [[Dyalog APL]]'s US English keyboard layout, but can easily be adapted to similar layouts.
=== Number row keys ===
=== Number row keys ===
<source lang=apl inline>⋄</source> begins new APL expressions just like <kbd>`</kbd> button begins the main section of the keyboard. <source lang=apl inline>⌺</source> is a modified version of <source lang=apl inline>⌺</source>, so it is <kbd>Shift</kbd>+<source lang=apl inline>⋄</source>.
<source lang=apl inline>⋄</syntaxhighlight> begins new APL expressions just like <kbd>`</kbd> button begins the main section of the keyboard. <source lang=apl inline>⌺</syntaxhighlight> is a modified version of <source lang=apl inline>⌺</syntaxhighlight>, so it is <kbd>Shift</kbd>+<source lang=apl inline>⋄</syntaxhighlight>.


<source lang=apl inline>¨</source> applies a function to each 1 of the argument elements, so it is on <kbd>APL</kbd>+<kbd>1</kbd>. <source lang=apl inline>⌶</source> looks like a [[wikipedia:Roman numerals|Roman numeral]] 1, so it also lives on the <kbd>1</kbd>, albeit in the shifted position.
<source lang=apl inline>¨</syntaxhighlight> applies a function to each 1 of the argument elements, so it is on <kbd>APL</kbd>+<kbd>1</kbd>. <source lang=apl inline>⌶</syntaxhighlight> looks like a [[wikipedia:Roman numerals|Roman numeral]] 1, so it also lives on the <kbd>1</kbd>, albeit in the shifted position.


<source lang=apl inline>¯</source>, <source lang=apl inline><</source>, <source lang=apl inline>≤</source>, <source lang=apl inline>=</source>, <source lang=apl inline>≥</source>, <source lang=apl inline>></source>, and <source lang=apl inline>≠</source> 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 <source lang=apl inline>=</source>. <kbd>4</kbd> and <kbd>6</kbd> are slightly less and more, respectively, so they give <source lang=apl inline>≤</source> and <source lang=apl inline>≥</source>. <kbd>3</kbd> and <kbd>7</kbd> are much less and more, respectively, so they give <source lang=apl inline><</source> and <source lang=apl inline>></source>. Finally, <kbd>2</kbd> is so much less that it is negative, giving the negative sign <source lang=apl inline>¯</source>, and <kbd>8</kbd> is so much greater that it is completely [[not equal|unequal]], <source lang=apl inline>≠</source>.
<source lang=apl inline>¯</syntaxhighlight>, <source lang=apl inline><</syntaxhighlight>, <source lang=apl inline>≤</syntaxhighlight>, <source lang=apl inline>=</syntaxhighlight>, <source lang=apl inline>≥</syntaxhighlight>, <source lang=apl inline>></syntaxhighlight>, and <source 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 <source lang=apl inline>=</syntaxhighlight>. <kbd>4</kbd> and <kbd>6</kbd> are slightly less and more, respectively, so they give <source lang=apl inline>≤</syntaxhighlight> and <source lang=apl inline>≥</syntaxhighlight>. <kbd>3</kbd> and <kbd>7</kbd> are much less and more, respectively, so they give <source lang=apl inline><</syntaxhighlight> and <source lang=apl inline>></syntaxhighlight>. Finally, <kbd>2</kbd> is so much less that it is negative, giving the negative sign <source lang=apl inline>¯</syntaxhighlight>, and <kbd>8</kbd> is so much greater that it is completely [[not equal|unequal]], <source lang=apl inline>≠</syntaxhighlight>.


<source lang=apl inline>⍒</source> and <source lang=apl inline>⍋</source> are located on <kbd>#</kbd> (read "pound", <kbd>£</kbd> on British keyboards). <source lang=apl inline>⍒</source> 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:Brexit|Brexit]].
<source lang=apl inline>⍒</syntaxhighlight> and <source lang=apl inline>⍋</syntaxhighlight> are located on <kbd>#</kbd> (read "pound", <kbd>£</kbd> on British keyboards). <source 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:Brexit|Brexit]].


<source lang=apl inline>⌽</source> mirrors an array over its vertical centre, so it is placed on the centre of the 1–9 number line. <source lang=apl inline>⍉</source> is slightly off centre, while <source lang=apl inline>⊖</source> has completely fallen over.
<source lang=apl inline>⌽</syntaxhighlight> mirrors an array over its vertical centre, so it is placed on the centre of the 1–9 number line. <source lang=apl inline>⍉</syntaxhighlight> is slightly off centre, while <source lang=apl inline>⊖</syntaxhighlight> has completely fallen over.


<source lang=apl inline>∨</source> and <source lang=apl inline>∧</source> are on the largest (<kbd>9</kbd>) and smallest (<kbd>0</kbd>) digits, respectively, as <source lang=apl inline>∨</source> is inclusive (any argument being true gives true) while <source lang=apl inline>∧</source> is exclusive (any false gives false). Their negated versions <source lang=apl inline>⍱</source> and <source lang=apl inline>⍲</source> are on the shifted positions.
<source lang=apl inline>∨</syntaxhighlight> and <source lang=apl inline>∧</syntaxhighlight> are on the largest (<kbd>9</kbd>) and smallest (<kbd>0</kbd>) digits, respectively, as <source lang=apl inline>∨</syntaxhighlight> is inclusive (any argument being true gives true) while <source lang=apl inline>∧</syntaxhighlight> is exclusive (any false gives false). Their negated versions <source lang=apl inline>⍱</syntaxhighlight> and <source lang=apl inline>⍲</syntaxhighlight> are on the shifted positions.


<source lang=apl inline>×</source> is adjacent to <source lang=apl inline>∧</source> for which it is equivalent on [[Boolean]] arguments. <source lang=apl inline>!</source> is above it, being <source lang=apl inline>×/⍳</source>. <source lang=apl inline>÷</source> is adjacent to its inverse, <source lang=apl inline>×</source>. And <source lang=apl inline>⌹</source> is in the shifted position, being the [[matrix]] equivalent of <source lang=apl inline>÷</source>.
<source lang=apl inline>×</syntaxhighlight> is adjacent to <source lang=apl inline>∧</syntaxhighlight> for which it is equivalent on [[Boolean]] arguments. <source lang=apl inline>!</syntaxhighlight> is above it, being <source lang=apl inline>×/⍳</syntaxhighlight>. <source lang=apl inline>÷</syntaxhighlight> is adjacent to its inverse, <source lang=apl inline>×</syntaxhighlight>. And <source lang=apl inline>⌹</syntaxhighlight> is in the shifted position, being the [[matrix]] equivalent of <source lang=apl inline>÷</syntaxhighlight>.
=== Top row keys ===
=== Top row keys ===
<source lang=apl inline>?</source> is on <kbd>q</kbd> for '''''q'''uestion''.
<source lang=apl inline>?</syntaxhighlight> is on <kbd>q</kbd> for '''''q'''uestion''.


<source lang=apl inline>⍵</source>, <source lang=apl inline>∊</source>, and <source lang=apl inline>⍳</source> look similar to <kbd>w</kbd>, <kbd>e</kbd>, and <kbd>i</kbd>. <source lang=apl inline>⍷</source> and <source lang=apl inline>⍸</source> are the shifted variants of <source lang=apl inline>∊</source> and <source lang=apl inline>⍳</source>. The Greek letters <source lang=apl inline>∊</source>, and <source lang=apl inline>⍳</source> are also equivalent to the Latin ''e'', and ''i''.
<source lang=apl inline>⍵</syntaxhighlight>, <source lang=apl inline>∊</syntaxhighlight>, and <source lang=apl inline>⍳</syntaxhighlight> look similar to <kbd>w</kbd>, <kbd>e</kbd>, and <kbd>i</kbd>. <source lang=apl inline>⍷</syntaxhighlight> and <source lang=apl inline>⍸</syntaxhighlight> are the shifted variants of <source lang=apl inline>∊</syntaxhighlight> and <source lang=apl inline>⍳</syntaxhighlight>. The Greek letters <source lang=apl inline>∊</syntaxhighlight>, and <source lang=apl inline>⍳</syntaxhighlight> are also equivalent to the Latin ''e'', and ''i''.


<source lang=apl inline>⍴</source> is the Greek equivalent of ''r''.
<source lang=apl inline>⍴</syntaxhighlight> is the Greek equivalent of ''r''.


<source lang=apl inline>~</source> is on <kbd>t</kbd> for its name '''''t'''ilde'', and its variant with diaeresis, <source lang=apl inline>⍨</source>, is on the shifted position.
<source lang=apl inline>~</syntaxhighlight> is on <kbd>t</kbd> for its name '''''t'''ilde'', and its variant with diaeresis, <source lang=apl inline>⍨</syntaxhighlight>, is on the shifted position.


<source lang=apl inline>↑</source> is on <kbd>y</kbd> for '''''y'''ank'' (=take), and <source lang=apl inline>↓</source> is on the adjacent <kbd>u</kbd> for '''''drop''' down '''u'''nder''.
<source lang=apl inline>↑</syntaxhighlight> is on <kbd>y</kbd> for '''''y'''ank'' (=take), and <source lang=apl inline>↓</syntaxhighlight> is on the adjacent <kbd>u</kbd> for '''''drop''' down '''u'''nder''.


<source lang=apl inline>○</source> is on <kbd>o</kbd> due to the similar looks, and <source lang=apl inline>⍥</source> is the shifted variant. <source lang=apl inline>⍥</source> is also on <kbd>O</kbd> for '''''O'''ver''.
<source lang=apl inline>○</syntaxhighlight> is on <kbd>o</kbd> due to the similar looks, and <source lang=apl inline>⍥</syntaxhighlight> is the shifted variant. <source lang=apl inline>⍥</syntaxhighlight> is also on <kbd>O</kbd> for '''''O'''ver''.


<source lang=apl inline>*</source> is on <kbd>p</kbd> for '''''p'''ower'', and <source lang=apl inline>⍣</source> is the shifted variant.
<source lang=apl inline>*</syntaxhighlight> is on <kbd>p</kbd> for '''''p'''ower'', and <source lang=apl inline>⍣</syntaxhighlight> is the shifted variant.


<source lang=apl inline>←</source>  and <source lang=apl inline>→</source> match the directionality of <kbd>[</kbd> and <kbd>]</kbd>. <source lang=apl inline>⍞</source> is usually immediately assigned to/from using <source lang=apl inline>←</source>, so they share key. <source lang=apl inline>⍬</source> is the empty vector and vectors are usually pictured as arrows pointing right, so it shares key with <source lang=apl inline>→</source>.
<source lang=apl inline>←</syntaxhighlight>  and <source lang=apl inline>→</syntaxhighlight> match the directionality of <kbd>[</kbd> and <kbd>]</kbd>. <source lang=apl inline>⍞</syntaxhighlight> is usually immediately assigned to/from using <source lang=apl inline>←</syntaxhighlight>, so they share key. <source lang=apl inline>⍬</syntaxhighlight> is the empty vector and vectors are usually pictured as arrows pointing right, so it shares key with <source lang=apl inline>→</syntaxhighlight>.


<source lang=apl inline>⊢</source> is on the '''right'''most key, and its shifted variant <source lang=apl inline>⊣</source> points the other way.
<source lang=apl inline>⊢</syntaxhighlight> is on the '''right'''most key, and its shifted variant <source lang=apl inline>⊣</syntaxhighlight> points the other way.
=== Home row keys ===
=== Home row keys ===
<source lang=apl inline>⍺</source> looks similar to <kbd>a</kbd>. The Greek letter <source lang=apl inline>⍺</source>is also equivalent to the Latin ''a''. Finally, <source lang=apl inline>⍺</source>, being the left argument, is (below and) to the left of the right argument <source lang=apl inline>⍵</source> on <kbd>w</kbd>.
<source lang=apl inline>⍺</syntaxhighlight> looks similar to <kbd>a</kbd>. The Greek letter <source lang=apl inline>⍺</syntaxhighlight>is also equivalent to the Latin ''a''. Finally, <source lang=apl inline>⍺</syntaxhighlight>, being the left argument, is (below and) to the left of the right argument <source lang=apl inline>⍵</syntaxhighlight> on <kbd>w</kbd>.


<source lang=apl inline>⌈</source> is on <kbd>s</kbd> for '''''s'''eiling'' (since ''c'' is pronounced like ''s'' here) and also finds the superlative argument. <source lang=apl inline>∊</source> is adjacent on <kbd>d</kbd> for ''rounding '''d'''own''.
<source 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. <source lang=apl inline>∊</syntaxhighlight> is adjacent on <kbd>d</kbd> for ''rounding '''d'''own''.


<source lang=apl inline>_</source> is on <kbd>f</kbd> for being a '''''f'''loormat''.
<source lang=apl inline>_</syntaxhighlight> is on <kbd>f</kbd> for being a '''''f'''loormat''.


<source lang=apl inline>∇</source> 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, <source lang=apl inline>∆</source>, which is a '''''h'''ome'' tent, located on on <kbd>h</kbd>.
<source 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, <source lang=apl inline>∆</syntaxhighlight>, which is a '''''h'''ome'' tent, located on on <kbd>h</kbd>.


<source lang=apl inline>∘</source> on <kbd>j</kbd> is called '''''j'''ot''. Its variant with diaeresis, <source lang=apl inline>⍤</source>, is on the shifted position.
<source lang=apl inline>∘</syntaxhighlight> on <kbd>j</kbd> is called '''''j'''ot''. Its variant with diaeresis, <source lang=apl inline>⍤</syntaxhighlight>, is on the shifted position.


<source lang=apl inline>'</source> is on <kbd>k</kbd> for '''''k'''uote'' (since ''q'' is reserved for ''question'', as in "Q&A").
<source lang=apl inline>'</syntaxhighlight> is on <kbd>k</kbd> for '''''k'''uote'' (since ''q'' is reserved for ''question'', as in "Q&A").


<source lang=apl inline>⌸</source> is also on <kbd>K</kbd> for '''''K'''ey''.
<source lang=apl inline>⌸</syntaxhighlight> is also on <kbd>K</kbd> for '''''K'''ey''.


<source lang=apl inline>⎕</source> is on <kbd>L</kbd> which looks like its lower left half. <source lang=apl inline>⌷</source> is its squished equivalent, on the shifted key.
<source lang=apl inline>⎕</syntaxhighlight> is on <kbd>L</kbd> which looks like its lower left half. <source lang=apl inline>⌷</syntaxhighlight> is its squished equivalent, on the shifted key.


<source lang=apl inline>⍎</source> executes code, and is on <kbd>;</kbd> which is a ubiquitous symbol in code. Adjacent is <source lang=apl inline>⍕</source> which is its inverse and is found on <kbd>'</kbd> because it makes things into text, as indicated by the quote.
<source lang=apl inline>⍎</syntaxhighlight> executes code, and is on <kbd>;</kbd> which is a ubiquitous symbol in code. Adjacent is <source 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.


<source lang=apl inline>≡</source> is on <kbd>:</kbd> — a stack of lines on a stack of dots. <source lang=apl inline>≢</source> is its negation and is found adjacent to it, on the <kbd>'</kbd> key, <source lang=apl inline>≢</source> being a <source lang=apl inline>≡</source> with a <code>'</code> drawn on top.
<source lang=apl inline>≡</syntaxhighlight> is on <kbd>:</kbd> — a stack of lines on a stack of dots. <source lang=apl inline>≢</syntaxhighlight> is its negation and is found adjacent to it, on the <kbd>'</kbd> key, <source lang=apl inline>≢</syntaxhighlight> being a <source lang=apl inline>≡</syntaxhighlight> with a <code>'</code> drawn on top.
=== Bottom row keys ===
=== Bottom row keys ===
<source lang=apl inline>⊂</source> is on <kbd>z</kbd> because it '''''z'''ips'' up (encloses) a value into a scalar. Its shifted variant <source lang=apl inline>⊆</source> only does so conditionally. Its inverse and mirror-image, <source lang=apl inline>⊃</source>, is located adjacent, on <kbd>x</kbd> because it ''e'''x'''tracts'' (discloses) the content of an enclosed scalar.
<source lang=apl inline>⊂</syntaxhighlight> is on <kbd>z</kbd> because it '''''z'''ips'' up (encloses) a value into a scalar. Its shifted variant <source lang=apl inline>⊆</syntaxhighlight> only does so conditionally. Its inverse and mirror-image, <source lang=apl inline>⊃</syntaxhighlight>, is located adjacent, on <kbd>x</kbd> because it ''e'''x'''tracts'' (discloses) the content of an enclosed scalar.


<source lang=apl inline>∩</source> is on <kbd>c</kbd> for '''''c'''ap'', and its upturned variant, <source lang=apl inline>∪</source>, is adjacent on <kbd>v</kbd> to which it is visually similar.
<source lang=apl inline>∩</syntaxhighlight> is on <kbd>c</kbd> for '''''c'''ap'', and its upturned variant, <source lang=apl inline>∪</syntaxhighlight>, is adjacent on <kbd>v</kbd> to which it is visually similar.


<source lang=apl inline>⊥</source> is on <kbd>b</kbd> because it evaluates digits in a given '''''b'''ase''. Its upturned variant <source lang=apl inline>⊤</source> is adjacent on <kbd>n</kbd> because it (''e'')'''''n'''code''s a normal '''''n'''umber'' to a custom '''''n'''umber'' system.
<source lang=apl inline>⊥</syntaxhighlight> is on <kbd>b</kbd> because it evaluates digits in a given '''''b'''ase''. Its upturned variant <source 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.


<source lang=apl inline>|</source> is on <kbd>m</kbd> for '''''modulo''/'''''m'''agnitude'' and '''''modulus''.
<source lang=apl inline>|</syntaxhighlight> is on <kbd>m</kbd> for '''''modulo''/'''''m'''agnitude'' and '''''modulus''.


<source lang=apl inline>⍝</source> is on <kbd>,</kbd> due to the similarity of the words ''comma'' and ''comment''. Shifted <kbd>,</kbd> gives the barred version, <source lang=apl inline>⍪</source>.
<source 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, <source lang=apl inline>⍪</syntaxhighlight>.


<source lang=apl inline>⍀</source> is adjacent to its mirrored counter-part <source lang=apl inline>⌿</source> which in turn is a barred version of its key, <kbd>/</kbd>.
<source lang=apl inline>⍀</syntaxhighlight> is adjacent to its mirrored counter-part <source lang=apl inline>⌿</syntaxhighlight> which in turn is a barred version of its key, <kbd>/</kbd>.


<source lang=apl inline>⍠</source> varies the meaning of its operand, so it is in the corner on <kbd>?</kbd>, adjacent to all the shifting keys.
<source 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 ===
=== Summary ===
Line 182: Line 182:
! Default left argument
! Default left argument
|-
|-
| <source lang=apl inline>+</source>
| <source lang=apl inline>+</syntaxhighlight>
| <source lang=apl inline>0J¯2×11○x</source> i.e. <math>-2\!\cdot\!\Im(x)</math>
| <source lang=apl inline>0J¯2×11○x</syntaxhighlight> i.e. <math>-2\!\cdot\!\Im(x)</math>
|-
|-
| <source lang=apl inline>-</source>
| <source lang=apl inline>-</syntaxhighlight>
| 0
| 0
|-
|-
| <source lang=apl inline>×</source>
| <source lang=apl inline>×</syntaxhighlight>
| <source lang=apl inline>÷(|x)+x=0</source> i.e. <math>\frac1{|x|+[x=0]}</math>
| <source lang=apl inline>÷(|x)+x=0</syntaxhighlight> i.e. <math>\frac1{|x|+[x=0]}</math>
|-
|-
| <source lang=apl inline>÷</source>
| <source lang=apl inline>÷</syntaxhighlight>
| 1
| 1
|-
|-
| <source lang=apl inline>*</source>
| <source lang=apl inline>*</syntaxhighlight>
| <source lang=apl inline>*1</source> i.e. <math>e</math>
| <source lang=apl inline>*1</syntaxhighlight> i.e. <math>e</math>
|-
|-
| <source lang=apl inline>⍟</source>
| <source lang=apl inline>⍟</syntaxhighlight>
| <source lang=apl inline>*1</source> i.e. <math>e</math>
| <source lang=apl inline>*1</syntaxhighlight> i.e. <math>e</math>
|-
|-
| <source lang=apl inline>,</source>
| <source lang=apl inline>,</syntaxhighlight>
| <source lang=apl inline>⍬</source> (for scalars and vectors only)
| <source lang=apl inline>⍬</syntaxhighlight> (for scalars and vectors only)
|-
|-
| <source lang=apl inline>?</source>
| <source lang=apl inline>?</syntaxhighlight>
| 1 (almost; monadic form gives a scalar, dyadic form gives a vector)
| 1 (almost; monadic form gives a scalar, dyadic form gives a vector)
|-
|-
| <source lang=apl inline>⍒</source>
| <source lang=apl inline>⍒</syntaxhighlight>
| <source lang=apl inline>⎕UCS 0,⍳111411</source>
| <source lang=apl inline>⎕UCS 0,⍳111411</syntaxhighlight>
|-
|-
| <source lang=apl inline>⍋</source>
| <source lang=apl inline>⍋</syntaxhighlight>
| <source lang=apl inline>⎕UCS 0,⍳111411</source>
| <source lang=apl inline>⎕UCS 0,⍳111411</syntaxhighlight>
|-
|-
| <source lang=apl inline>⍉</source>
| <source lang=apl inline>⍉</syntaxhighlight>
| <source lang=apl inline>⌽⍳≢⍴x</source>
| <source lang=apl inline>⌽⍳≢⍴x</syntaxhighlight>
|-
|-
| <source lang=apl inline>⍎</source>
| <source lang=apl inline>⍎</syntaxhighlight>
| <source lang=apl inline>⎕THIS</source>
| <source lang=apl inline>⎕THIS</syntaxhighlight>
|-
|-
| <source lang=apl inline>⌹</source>
| <source lang=apl inline>⌹</syntaxhighlight>
| <source lang=apl inline>∘.=⍨⍳≢x</source> i.e. <math>I_n</math>
| <source lang=apl inline>∘.=⍨⍳≢x</syntaxhighlight> i.e. <math>I_n</math>
|-
|-
| <source lang=apl inline>⊂</source>
| <source lang=apl inline>⊂</syntaxhighlight>
| <source lang=apl inline>,1</source> (almost; monadic form gives a scalar, dyadic form gives a vector)
| <source lang=apl inline>,1</syntaxhighlight> (almost; monadic form gives a scalar, dyadic form gives a vector)
|-
|-
| <source lang=apl inline>⊃</source>
| <source lang=apl inline>⊃</syntaxhighlight>
| <source lang=apl inline>⊂(≢⍴x)⍴1</source>
| <source lang=apl inline>⊂(≢⍴x)⍴1</syntaxhighlight>
|-
|-
| <source lang=apl inline>∪</source>
| <source lang=apl inline>∪</syntaxhighlight>
| <source lang=apl inline>∪x</source>
| <source lang=apl inline>∪x</syntaxhighlight>
|-
|-
| <source lang=apl inline>⌷</source>
| <source lang=apl inline>⌷</syntaxhighlight>
| <source lang=apl inline>⊂⍳≢⌷x</source>
| <source lang=apl inline>⊂⍳≢⌷x</syntaxhighlight>
|-
|-
| <source lang=apl inline>⊣</source>
| <source lang=apl inline>⊣</syntaxhighlight>
| <source lang=apl inline>x</source>
| <source lang=apl inline>x</syntaxhighlight>
|-
|-
| <source lang=apl inline>⊢</source>
| <source lang=apl inline>⊢</syntaxhighlight>
| <source lang=apl inline>x</source>
| <source lang=apl inline>x</syntaxhighlight>
|}
|}


Line 246: Line 246:
! Explanation
! Explanation
|-
|-
| <source lang=apl inline>≡</source>
| <source lang=apl inline>≡</syntaxhighlight>
| indicates (3) layers of depth for the monadic form
| indicates (3) layers of depth for the monadic form
|-
|-
| <source lang=apl inline>≢</source>
| <source lang=apl inline>≢</syntaxhighlight>
| indicates a counting rod marking for the monadic form
| indicates a counting rod marking for the monadic form
|-
|-
| <source lang=apl inline>↑</source>
| <source lang=apl inline>↑</syntaxhighlight>
| take elements and increase rank
| take elements and increase rank
|-
|-
| <source lang=apl inline>↓</source>
| <source lang=apl inline>↓</syntaxhighlight>
| drop elements and decrease rank
| drop elements and decrease rank
|-
|-
| <source lang=apl inline>∊</source>
| <source lang=apl inline>∊</syntaxhighlight>
| &quot;'''e'''lement of&quot; and &quot;'''e'''nlist&quot;
| &quot;'''e'''lement of&quot; and &quot;'''e'''nlist&quot;
|-
|-
| <source lang=apl inline>⊆</source>
| <source lang=apl inline>⊆</syntaxhighlight>
| &quot;enclose at positions where condition is met&quot; and &quot;enclose on condition of being simple&quot;
| &quot;enclose at positions where condition is met&quot; and &quot;enclose on condition of being simple&quot;
|-
|-
| <source lang=apl inline>⍸</source>
| <source lang=apl inline>⍸</syntaxhighlight>
| &quot;'''i'''ndices where elements fit into intervals&quot; and &quot;'''i'''ndices where true&quot;
| &quot;'''i'''ndices where elements fit into intervals&quot; and &quot;'''i'''ndices where true&quot;
|-
|-
| <source lang=apl inline>⍪</source>
| <source lang=apl inline>⍪</syntaxhighlight>
| <source lang=apl inline>,[1]x</source> (for non-scalars) and <source lang=apl inline>,⍤¯1</source> (for higher-rank arrays)
| <source lang=apl inline>,[1]x</syntaxhighlight> (for non-scalars) and <source lang=apl inline>,⍤¯1</syntaxhighlight> (for higher-rank arrays)
|}
|}


Line 277: Line 277:
! Relationship
! Relationship
|-
|-
| <source lang=apl inline>⌈</source>
| <source lang=apl inline>⌈</syntaxhighlight>
| next higher integer or highest argument
| next higher integer or highest argument
|-
|-
| <source lang=apl inline>⌊</source>
| <source lang=apl inline>⌊</syntaxhighlight>
| next lower integer or lowest argument
| next lower integer or lowest argument
|-
|-
| <source lang=apl inline>|</source>
| <source lang=apl inline>|</syntaxhighlight>
| both forms can be called [[wikipedia:modulo|modulo]] and use the symbol: <math>|x|</math> and <math>a|b</math>
| both forms can be called [[wikipedia:modulo|modulo]] and use the symbol: <math>|x|</math> and <math>a|b</math>
|-
|-
| <source lang=apl inline>!</source>
| <source lang=apl inline>!</syntaxhighlight>
| factorial is prominent in the formula for binomial
| factorial is prominent in the formula for binomial
|-
|-
| <source lang=apl inline>○</source>
| <source lang=apl inline>○</syntaxhighlight>
| both the trigonometric functions and <math>\pi</math> relate to the (unit) circle
| both the trigonometric functions and <math>\pi</math> relate to the (unit) circle
|-
|-
| <source lang=apl inline>~</source>
| <source lang=apl inline>~</syntaxhighlight>
| &quot;not&quot; and &quot;but not&quot;
| &quot;not&quot; and &quot;but not&quot;
|-
|-
| <source lang=apl inline>≠</source>
| <source lang=apl inline>≠</syntaxhighlight>
| monadic means &quot;not equal to any preceding item&quot;
| monadic means &quot;not equal to any preceding item&quot;
|-
|-
| <source lang=apl inline>⍴</source>
| <source lang=apl inline>⍴</syntaxhighlight>
| shape and reshape
| shape and reshape
|-
|-
| <source lang=apl inline>⍳</source>
| <source lang=apl inline>⍳</syntaxhighlight>
| indices of and index of
| indices of and index of
|-
|-
| <source lang=apl inline>⌽</source>
| <source lang=apl inline>⌽</syntaxhighlight>
| rotate and mirror along last axis
| rotate and mirror along last axis
|-
|-
| <source lang=apl inline>⊖</source>
| <source lang=apl inline>⊖</syntaxhighlight>
| rotate and mirror along first axis
| rotate and mirror along first axis
|-
|-
| <source lang=apl inline>⍕</source>
| <source lang=apl inline>⍕</syntaxhighlight>
| format and format with specification
| format and format with specification
|}
|}

Revision as of 21:09, 10 September 2022

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 aide-mémoires.

Pairing glyphs with their meaning

Many glyphs have meaning identical to their mathematical counterparts.

<source lang=apl inline>⋄</syntaxhighlight> (Diamond) separates statements. That is, no functions or operators can break through <source lang=apl inline>⋄</syntaxhighlight>, just as diamonds are virtually indestructible.

<source lang=apl inline>⌺</syntaxhighlight> looks like a <source lang=apl inline>⋄</syntaxhighlight>-shaped Stencil laid on a piece of paper, <source lang=apl inline>⎕</syntaxhighlight>.

<source lang=apl inline>!</syntaxhighlight> is Binomial in addition to Factorial, as the two are closely related.

I-beam <source lang=apl inline>⌶</syntaxhighlight> does look like an I-beam

<source lang=apl inline>⌶</syntaxhighlight> (I-beam) calls system services. APL was originally developed at IBM, so system services were also IBM services. <source lang=apl inline>⌶</syntaxhighlight> is an I-beam and I-beam is pronounced almost identically to IBM.

<source lang=apl inline>@</syntaxhighlight> applies a function or substitutes elements at specific locations.

The Grade glyphs <source lang=apl inline>⍋</syntaxhighlight> and <source lang=apl inline>⍒</syntaxhighlight> look like supersonic transports.

<source lang=apl inline>⍋</syntaxhighlight> and <source lang=apl inline>⍒</syntaxhighlight> give the indices (grades) needed to sort ascending and descending respectively, and look like an ascending and descending supersonic transport, respectively.

<source lang=apl inline>⌽</syntaxhighlight>, <source lang=apl inline>⊖</syntaxhighlight>, and <source lang=apl inline>⍉</syntaxhighlight> reverse or transpose an array over a given axis. The <source lang=apl inline>○</syntaxhighlight> part of the glyphs symbolise the array, while the line component (<source lang=apl inline>|</syntaxhighlight>, <source lang=apl inline>\</syntaxhighlight>, or <source lang=apl inline>-</syntaxhighlight>) indicates the line across which the reversal/transposal is done.

The Log glyph <source lang=apl inline>⍟</syntaxhighlight> looks like a tree log.

<source lang=apl inline>⍟</syntaxhighlight> looks like the cross-section of a tree log

<source lang=apl inline>⍱</syntaxhighlight> and <source lang=apl inline>⍲</syntaxhighlight> (Nor and Nand) have the Not glyph <source lang=apl inline>~</syntaxhighlight> on top of or overlaid on the Or glyph <source lang=apl inline>∨</syntaxhighlight> and And glyph <source lang=apl inline>∧</syntaxhighlight> respectively.

<source lang=apl inline>×</syntaxhighlight> can be seen as an when monadic, indicating the unknown sign to be determined.

<source lang=apl inline>+</syntaxhighlight> negates the imaginary part (that is, it conjugates) by analogy to monadic <source lang=apl inline>-</syntaxhighlight> which negates both the real and the imaginary parts.

<source lang=apl inline>÷</syntaxhighlight> takes a default left argument of <source lang=apl inline>1</syntaxhighlight> (thus computing the reciprocal), that being the identity element of division.

<source lang=apl inline>⌹</syntaxhighlight> is matrix divide with a <source lang=apl inline>⎕</syntaxhighlight> symbolising a matrix and an inscribed <source lang=apl inline>÷</syntaxhighlight> for "divide".

<source lang=apl inline>?</syntaxhighlight> symbolises the unknown, and thus rolls dice and deals cards randomly.

<source lang=apl inline>⍺</syntaxhighlight> and <source lang=apl inline>⍵</syntaxhighlight> are the leftmost and rightmost letters of the Greek alphabet. They therefore denote the left and right arguments of dfns, respectively.

<source lang=apl inline>∊</syntaxhighlight> is the Greek letter Epsilon which corresponds to the letter E for Enlist and Element of.

<source lang=apl inline>⍴</syntaxhighlight> is the Greek letter Rho which corresponds to the letter R for Reshape.

<source lang=apl inline>~</syntaxhighlight> is Not when monadic, but its dyadic form, Without, can also be remembered as but not.

<source lang=apl inline>⍨</syntaxhighlight> 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.

<source lang=apl inline>↑</syntaxhighlight> and <source lang=apl inline>↓</syntaxhighlight> (Mix and Split) increase and decrease rank (if possible) when used monadically.

<source lang=apl inline>↓</syntaxhighlight> drops elements, and so it points down, the direction in which things are dropped. Take uses <source lang=apl inline>↑</syntaxhighlight> by analogy.

<source lang=apl inline>⍳</syntaxhighlight> is the Greek letter Iota which corresponds to the letter I for Index generator and Index of.

<source lang=apl inline>⍸</syntaxhighlight> is also the Greek letter Iota which corresponds to the letter I for Indices and Interval Index.

<source lang=apl inline>○</syntaxhighlight> is a circle for Circular functions and the ratio between the circumference and the diameter of a circle, Pi.

<source lang=apl inline>⍥</syntaxhighlight> and <source lang=apl inline>⍤</syntaxhighlight> (Over and Atop) both apply the left operand after the right operand. However, <source lang=apl inline>⍥</syntaxhighlight> has a larger "circle of influence" in that it applies its right operand twice (once on each argument) while <source lang=apl inline>⍤</syntaxhighlight> only applies it once (between the arguments).

<source lang=apl inline>*</syntaxhighlight> and <source lang=apl inline>⍣</syntaxhighlight> repeatedly apply multiplication and a function, respectively. The star symbolises power (function)/power (operator).

<source lang=apl inline>←</syntaxhighlight> assigns by putting the value on its right into the name on its left.

<source lang=apl inline>→</syntaxhighlight> points at the destination it is branching to.

<source lang=apl inline>⍬</syntaxhighlight> (Zilde) is a combination of <source lang=apl inline>~</syntaxhighlight> for Without and <source lang=apl inline>0</syntaxhighlight> indicating numbers. Indeed, it is the "vector without numbers", equivalent to <source lang=apl inline>0~0</syntaxhighlight>.

<source lang=apl inline>⊣</syntaxhighlight> and <source lang=apl inline>⊢</syntaxhighlight> point a finger towards the left and right, which are exactly the argument they, respectively, return.

The Quad glyph <source lang=apl inline>⎕</syntaxhighlight> looks like a console.

<source lang=apl inline>⎕</syntaxhighlight> 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. <source lang=apl inline>⍞</syntaxhighlight> looks like a <source lang=apl inline>⎕</syntaxhighlight> with a quote <source lang=apl inline>'</syntaxhighlight> indicating string input and message output.

<source lang=apl inline>⌈</syntaxhighlight> and <source lang=apl inline>⌊</syntaxhighlight> are pictograms of a wall with a piece of ceiling and floor, respectively.

<source lang=apl inline>⌈</syntaxhighlight> and <source lang=apl inline>⌊</syntaxhighlight> can also be seen as indicators on a vertical number line, pointing at the maximum and minimum, respectively.

<source lang=apl inline>∇</syntaxhighlight> is an upside-down Greek Delta, which corresponds to the letter D for Defined function or (own) definition (for recursion).

<source lang=apl inline>⌸</syntaxhighlight> (Key) applies a function for each collection of all elements that are equal (<source lang=apl inline>⌸</syntaxhighlight>).

<source lang=apl inline>≡</syntaxhighlight> can be see as a stack of layers. When used monadically, it finds the depth of an array.

<source 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.

<source lang=apl inline>⊂</syntaxhighlight> encloses its argument in a layer of nesting, and Disclose uses <source lang=apl inline>⊃</syntaxhighlight> by analogy. <source lang=apl inline>⊆</syntaxhighlight> is exactly like <source lang=apl inline>⊂</syntaxhighlight> except that it only does a conditional enclose, namely only if the argument is simple.

<source lang=apl inline>⊂</syntaxhighlight> and <source lang=apl inline>⊆</syntaxhighlight> enclose at specific locations, per a specification, so their dyadic forms are Partitioned enclose and Partition, respectively.

<source lang=apl inline>∪</syntaxhighlight> is a styled letter U for Unique or Union if used dyadically.

<source lang=apl inline>⊥</syntaxhighlight> looks like the base of a pillar. Antibase uses <source lang=apl inline>⊤</syntaxhighlight> by analogy.

The Lamp glyph <source lang=apl inline>⍝</syntaxhighlight> looks like a a lamp bulb filament.

<source lang=apl inline>⍝</syntaxhighlight> looks like a filament lamp and provides enlightenment by indicating comments.

<source lang=apl inline>,</syntaxhighlight> concatenates arrays, much like the common punctuation symbol concatenates phrases. <source lang=apl inline>⍪</syntaxhighlight> has an added styled row, indicating that for matrices, it concatenates additional rows.

<source lang=apl inline>.</syntaxhighlight> is just a low dot, but performs the same operation (though generalised) as traditional mathematics' dot product.

<source lang=apl inline>/</syntaxhighlight> and <source lang=apl inline>⌿</syntaxhighlight> 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

<source lang=apl inline>⋄</syntaxhighlight> begins new APL expressions just like ` button begins the main section of the keyboard. <source lang=apl inline>⌺</syntaxhighlight> is a modified version of <source lang=apl inline>⌺</syntaxhighlight>, so it is Shift+<source lang=apl inline>⋄</syntaxhighlight>.

<source lang=apl inline>¨</syntaxhighlight> applies a function to each 1 of the argument elements, so it is on APL+1. <source lang=apl inline>⌶</syntaxhighlight> looks like a Roman numeral 1, so it also lives on the 1, albeit in the shifted position.

<source lang=apl inline>¯</syntaxhighlight>, <source lang=apl inline><</syntaxhighlight>, <source lang=apl inline>≤</syntaxhighlight>, <source lang=apl inline>=</syntaxhighlight>, <source lang=apl inline>≥</syntaxhighlight>, <source lang=apl inline>></syntaxhighlight>, and <source 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 5 so that gives <source lang=apl inline>=</syntaxhighlight>. 4 and 6 are slightly less and more, respectively, so they give <source lang=apl inline>≤</syntaxhighlight> and <source lang=apl inline>≥</syntaxhighlight>. 3 and 7 are much less and more, respectively, so they give <source lang=apl inline><</syntaxhighlight> and <source lang=apl inline>></syntaxhighlight>. Finally, 2 is so much less that it is negative, giving the negative sign <source lang=apl inline>¯</syntaxhighlight>, and 8 is so much greater that it is completely unequal, <source lang=apl inline>≠</syntaxhighlight>.

<source lang=apl inline>⍒</syntaxhighlight> and <source lang=apl inline>⍋</syntaxhighlight> are located on # (read "pound", £ on British keyboards). <source 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 Brexit.

<source lang=apl inline>⌽</syntaxhighlight> mirrors an array over its vertical centre, so it is placed on the centre of the 1–9 number line. <source lang=apl inline>⍉</syntaxhighlight> is slightly off centre, while <source lang=apl inline>⊖</syntaxhighlight> has completely fallen over.

<source lang=apl inline>∨</syntaxhighlight> and <source lang=apl inline>∧</syntaxhighlight> are on the largest (9) and smallest (0) digits, respectively, as <source lang=apl inline>∨</syntaxhighlight> is inclusive (any argument being true gives true) while <source lang=apl inline>∧</syntaxhighlight> is exclusive (any false gives false). Their negated versions <source lang=apl inline>⍱</syntaxhighlight> and <source lang=apl inline>⍲</syntaxhighlight> are on the shifted positions.

<source lang=apl inline>×</syntaxhighlight> is adjacent to <source lang=apl inline>∧</syntaxhighlight> for which it is equivalent on Boolean arguments. <source lang=apl inline>!</syntaxhighlight> is above it, being <source lang=apl inline>×/⍳</syntaxhighlight>. <source lang=apl inline>÷</syntaxhighlight> is adjacent to its inverse, <source lang=apl inline>×</syntaxhighlight>. And <source lang=apl inline>⌹</syntaxhighlight> is in the shifted position, being the matrix equivalent of <source lang=apl inline>÷</syntaxhighlight>.

Top row keys

<source lang=apl inline>?</syntaxhighlight> is on q for question.

<source lang=apl inline>⍵</syntaxhighlight>, <source lang=apl inline>∊</syntaxhighlight>, and <source lang=apl inline>⍳</syntaxhighlight> look similar to w, e, and i. <source lang=apl inline>⍷</syntaxhighlight> and <source lang=apl inline>⍸</syntaxhighlight> are the shifted variants of <source lang=apl inline>∊</syntaxhighlight> and <source lang=apl inline>⍳</syntaxhighlight>. The Greek letters <source lang=apl inline>∊</syntaxhighlight>, and <source lang=apl inline>⍳</syntaxhighlight> are also equivalent to the Latin e, and i.

<source lang=apl inline>⍴</syntaxhighlight> is the Greek equivalent of r.

<source lang=apl inline>~</syntaxhighlight> is on t for its name tilde, and its variant with diaeresis, <source lang=apl inline>⍨</syntaxhighlight>, is on the shifted position.

<source lang=apl inline>↑</syntaxhighlight> is on y for yank (=take), and <source lang=apl inline>↓</syntaxhighlight> is on the adjacent u for drop down under.

<source lang=apl inline>○</syntaxhighlight> is on o due to the similar looks, and <source lang=apl inline>⍥</syntaxhighlight> is the shifted variant. <source lang=apl inline>⍥</syntaxhighlight> is also on O for Over.

<source lang=apl inline>*</syntaxhighlight> is on p for power, and <source lang=apl inline>⍣</syntaxhighlight> is the shifted variant.

<source lang=apl inline>←</syntaxhighlight> and <source lang=apl inline>→</syntaxhighlight> match the directionality of [ and ]. <source lang=apl inline>⍞</syntaxhighlight> is usually immediately assigned to/from using <source lang=apl inline>←</syntaxhighlight>, so they share key. <source lang=apl inline>⍬</syntaxhighlight> is the empty vector and vectors are usually pictured as arrows pointing right, so it shares key with <source lang=apl inline>→</syntaxhighlight>.

<source lang=apl inline>⊢</syntaxhighlight> is on the rightmost key, and its shifted variant <source lang=apl inline>⊣</syntaxhighlight> points the other way.

Home row keys

<source lang=apl inline>⍺</syntaxhighlight> looks similar to a. The Greek letter <source lang=apl inline>⍺</syntaxhighlight>is also equivalent to the Latin a. Finally, <source lang=apl inline>⍺</syntaxhighlight>, being the left argument, is (below and) to the left of the right argument <source lang=apl inline>⍵</syntaxhighlight> on w.

<source lang=apl inline>⌈</syntaxhighlight> is on s for seiling (since c is pronounced like s here) and also finds the superlative argument. <source lang=apl inline>∊</syntaxhighlight> is adjacent on d for rounding down.

<source lang=apl inline>_</syntaxhighlight> is on f for being a floormat.

<source lang=apl inline>∇</syntaxhighlight> is on g for go!, indicating the beginning of a function definition or going around again (recursion). Adjecent, we find its upturned variant, <source lang=apl inline>∆</syntaxhighlight>, which is a home tent, located on on h.

<source lang=apl inline>∘</syntaxhighlight> on j is called jot. Its variant with diaeresis, <source lang=apl inline>⍤</syntaxhighlight>, is on the shifted position.

<source lang=apl inline>'</syntaxhighlight> is on k for kuote (since q is reserved for question, as in "Q&A").

<source lang=apl inline>⌸</syntaxhighlight> is also on K for Key.

<source lang=apl inline>⎕</syntaxhighlight> is on L which looks like its lower left half. <source lang=apl inline>⌷</syntaxhighlight> is its squished equivalent, on the shifted key.

<source lang=apl inline>⍎</syntaxhighlight> executes code, and is on ; which is a ubiquitous symbol in code. Adjacent is <source lang=apl inline>⍕</syntaxhighlight> which is its inverse and is found on ' because it makes things into text, as indicated by the quote.

<source lang=apl inline>≡</syntaxhighlight> is on : — a stack of lines on a stack of dots. <source lang=apl inline>≢</syntaxhighlight> is its negation and is found adjacent to it, on the ' key, <source lang=apl inline>≢</syntaxhighlight> being a <source lang=apl inline>≡</syntaxhighlight> with a ' drawn on top.

Bottom row keys

<source lang=apl inline>⊂</syntaxhighlight> is on z because it zips up (encloses) a value into a scalar. Its shifted variant <source lang=apl inline>⊆</syntaxhighlight> only does so conditionally. Its inverse and mirror-image, <source lang=apl inline>⊃</syntaxhighlight>, is located adjacent, on x because it extracts (discloses) the content of an enclosed scalar.

<source lang=apl inline>∩</syntaxhighlight> is on c for cap, and its upturned variant, <source lang=apl inline>∪</syntaxhighlight>, is adjacent on v to which it is visually similar.

<source lang=apl inline>⊥</syntaxhighlight> is on b because it evaluates digits in a given base. Its upturned variant <source lang=apl inline>⊤</syntaxhighlight> is adjacent on n because it (e)ncodes a normal number to a custom number system.

<source lang=apl inline>|</syntaxhighlight> is on m for modulo/magnitude and modulus.

<source lang=apl inline>⍝</syntaxhighlight> is on , due to the similarity of the words comma and comment. Shifted , gives the barred version, <source lang=apl inline>⍪</syntaxhighlight>.

<source lang=apl inline>⍀</syntaxhighlight> is adjacent to its mirrored counter-part <source lang=apl inline>⌿</syntaxhighlight> which in turn is a barred version of its key, /.

<source lang=apl inline>⍠</syntaxhighlight> 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: 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

Glyph Default left argument
<source lang=apl inline>+</syntaxhighlight> <source lang=apl inline>0J¯2×11○x</syntaxhighlight> i.e.
<source lang=apl inline>-</syntaxhighlight> 0
<source lang=apl inline>×</syntaxhighlight> x)+x=0</syntaxhighlight> i.e.
<source lang=apl inline>÷</syntaxhighlight> 1
<source lang=apl inline>*</syntaxhighlight> <source lang=apl inline>*1</syntaxhighlight> i.e.
<source lang=apl inline>⍟</syntaxhighlight> <source lang=apl inline>*1</syntaxhighlight> i.e.
<source lang=apl inline>,</syntaxhighlight> <source lang=apl inline>⍬</syntaxhighlight> (for scalars and vectors only)
<source lang=apl inline>?</syntaxhighlight> 1 (almost; monadic form gives a scalar, dyadic form gives a vector)
<source lang=apl inline>⍒</syntaxhighlight> <source lang=apl inline>⎕UCS 0,⍳111411</syntaxhighlight>
<source lang=apl inline>⍋</syntaxhighlight> <source lang=apl inline>⎕UCS 0,⍳111411</syntaxhighlight>
<source lang=apl inline>⍉</syntaxhighlight> <source lang=apl inline>⌽⍳≢⍴x</syntaxhighlight>
<source lang=apl inline>⍎</syntaxhighlight> <source lang=apl inline>⎕THIS</syntaxhighlight>
<source lang=apl inline>⌹</syntaxhighlight> <source lang=apl inline>∘.=⍨⍳≢x</syntaxhighlight> i.e.
<source lang=apl inline>⊂</syntaxhighlight> <source lang=apl inline>,1</syntaxhighlight> (almost; monadic form gives a scalar, dyadic form gives a vector)
<source lang=apl inline>⊃</syntaxhighlight> <source lang=apl inline>⊂(≢⍴x)⍴1</syntaxhighlight>
<source lang=apl inline>∪</syntaxhighlight> <source lang=apl inline>∪x</syntaxhighlight>
<source lang=apl inline>⌷</syntaxhighlight> <source lang=apl inline>⊂⍳≢⌷x</syntaxhighlight>
<source lang=apl inline>⊣</syntaxhighlight> <source lang=apl inline>x</syntaxhighlight>
<source lang=apl inline>⊢</syntaxhighlight> <source lang=apl inline>x</syntaxhighlight>

Both forms are good fit for the glyph

Glyph Explanation
<source lang=apl inline>≡</syntaxhighlight> indicates (3) layers of depth for the monadic form
<source lang=apl inline>≢</syntaxhighlight> indicates a counting rod marking for the monadic form
<source lang=apl inline>↑</syntaxhighlight> take elements and increase rank
<source lang=apl inline>↓</syntaxhighlight> drop elements and decrease rank
<source lang=apl inline>∊</syntaxhighlight> "element of" and "enlist"
<source lang=apl inline>⊆</syntaxhighlight> "enclose at positions where condition is met" and "enclose on condition of being simple"
<source lang=apl inline>⍸</syntaxhighlight> "indices where elements fit into intervals" and "indices where true"
<source lang=apl inline>⍪</syntaxhighlight> <source lang=apl inline>,[1]x</syntaxhighlight> (for non-scalars) and <source lang=apl inline>,⍤¯1</syntaxhighlight> (for higher-rank arrays)

The two forms are conceptually related

Glyph Relationship
<source lang=apl inline>⌈</syntaxhighlight> next higher integer or highest argument
<source lang=apl inline>⌊</syntaxhighlight> next lower integer or lowest argument
</syntaxhighlight> both forms can be called modulo and use the symbol: and
<source lang=apl inline>!</syntaxhighlight> factorial is prominent in the formula for binomial
<source lang=apl inline>○</syntaxhighlight> both the trigonometric functions and relate to the (unit) circle
<source lang=apl inline>~</syntaxhighlight> "not" and "but not"
<source lang=apl inline>≠</syntaxhighlight> monadic means "not equal to any preceding item"
<source lang=apl inline>⍴</syntaxhighlight> shape and reshape
<source lang=apl inline>⍳</syntaxhighlight> indices of and index of
<source lang=apl inline>⌽</syntaxhighlight> rotate and mirror along last axis
<source lang=apl inline>⊖</syntaxhighlight> rotate and mirror along first axis
<source lang=apl inline>⍕</syntaxhighlight> format and format with specification


APL development [edit]
Interface SessionTyping glyphs (on Linux) ∙ FontsText editors
Publications IntroductionsLearning resourcesSimple examplesAdvanced examplesMnemonicsISO 8485:1989ISO/IEC 13751:2001A Dictionary of APLCase studiesDocumentation suitesBooksPapersVideosAPL Quote QuadVector journalTerminology (Chinese, German) ∙ Neural networksError trapping with Dyalog APL (in forms)
Sharing code Backwards compatibilityAPLcartAPLTreeAPL-CationDfns workspaceTatinCider
Implementation ResourcesOpen-sourceMagic functionPerformanceAPL hardware
Developers Timeline of corporationsAPL2000DyalogIBMIPSASTSC
APL glyphs [edit]
Information GlyphTyping glyphs (on Linux) ∙ UnicodeFontsMnemonicsOverstrikesMigration level
Individual glyphs Jot () ∙ Right Shoe () ∙ Up Arrow () ∙ Zilde () ∙ High minus (¯) ∙ Dot (.) ∙ Del ()