4,493
edits
Line 113: | Line 113: | ||
<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>¯</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>. | ||
== 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 | |||
|- | |||
| <source lang=apl inline>+</source> | |||
| <source lang=apl inline>0J¯2×11○x</source> i.e. <math>-2\!\cdot\!\Im(x)</math> | |||
|- | |||
| <source lang=apl inline>-</source> | |||
| 0 | |||
|- | |||
| <source lang=apl inline>×</source> | |||
| <source lang=apl inline>÷(|x)+x=0</source> i.e. <math>\frac1{|x|+[x=0]}</math> | |||
|- | |||
| <source lang=apl inline>÷</source> | |||
| 1 | |||
|- | |||
| <source lang=apl inline>*</source> | |||
| <source lang=apl inline>*1</source> i.e. <math>e</math> | |||
|- | |||
| <source lang=apl inline>⍟</source> | |||
| <source lang=apl inline>*1</source> i.e. <math>e</math> | |||
|- | |||
| <source lang=apl inline>,</source> | |||
| <source lang=apl inline>⍬</source> (for scalars and vectors only) | |||
|- | |||
| <source lang=apl inline>?</source> | |||
| 1 (almost; monadic form gives a scalar, dyadic form gives a vector) | |||
|- | |||
| <source lang=apl inline>⍒</source> | |||
| <source lang=apl inline>⎕UCS 0,⍳111411</source> | |||
|- | |||
| <source lang=apl inline>⍋</source> | |||
| <source lang=apl inline>⎕UCS 0,⍳111411</source> | |||
|- | |||
| <source lang=apl inline>⍉</source> | |||
| <source lang=apl inline>⌽⍳≢⍴x</source> | |||
|- | |||
| <source lang=apl inline>⍎</source> | |||
| <source lang=apl inline>⎕THIS</source> | |||
|- | |||
| <source lang=apl inline>⌹</source> | |||
| <source lang=apl inline>∘.=⍨⍳≢x</source> i.e. <math>I_n</math> | |||
|- | |||
| <source lang=apl inline>⊂</source> | |||
| <source lang=apl inline>,1</source> (almost; monadic form gives a scalar, dyadic form gives a vector) | |||
|- | |||
| <source lang=apl inline>⊃</source> | |||
| <source lang=apl inline>⊂(≢⍴x)⍴1</source> | |||
|- | |||
| <source lang=apl inline>∪</source> | |||
| <source lang=apl inline>∪x</source> | |||
|- | |||
| <source lang=apl inline>⌷</source> | |||
| <source lang=apl inline>⊂⍳≢⌷x</source> | |||
|- | |||
| <source lang=apl inline>⊣</source> | |||
| <source lang=apl inline>x</source> | |||
|- | |||
| <source lang=apl inline>⊢</source> | |||
| <source lang=apl inline>x</source> | |||
|} | |||
=== Both forms are good fit for the glyph === | |||
{| class=wikitable | |||
! Glyph | |||
! Explanation | |||
|- | |||
| <source lang=apl inline>≡</source> | |||
| indicates (3) layers of depth for the monadic form | |||
|- | |||
| <source lang=apl inline>≢</source> | |||
| indicates a counting rod marking for the monadic form | |||
|- | |||
| <source lang=apl inline>↑</source> | |||
| take elements and increase rank | |||
|- | |||
| <source lang=apl inline>↓</source> | |||
| drop elements and decrease rank | |||
|- | |||
| <source lang=apl inline>∊</source> | |||
| "'''e'''lement of" and "'''e'''nlist" | |||
|- | |||
| <source lang=apl inline>⊆</source> | |||
| "enclose at positions where condition is met" and "enclose on condition of being simple" | |||
|- | |||
| <source lang=apl inline>⍸</source> | |||
| "'''i'''ndices where elements fit into intervals" and "'''i'''ndices where true" | |||
|- | |||
| <source lang=apl inline>⍪</source> | |||
| <source lang=apl inline>,[1]x</source> (for non-scalars) and <source lang=apl inline>,⍤¯1</source> (for higher-rank arrays) | |||
|} | |||
=== The two forms are conceptually related === | |||
{| class=wikitable | |||
! Glyph | |||
! Relationship | |||
|- | |||
| <source lang=apl inline>⌈</source> | |||
| next higher integer or highest argument | |||
|- | |||
| <source lang=apl inline>⌊</source> | |||
| next lower integer or lowest argument | |||
|- | |||
| <source lang=apl inline>|</source> | |||
| 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> | |||
| factorial is prominent in the formula for binomial | |||
|- | |||
| <source lang=apl inline>○</source> | |||
| both the trigonometric functions and <math>\pi</math> relate to the (unit) circle | |||
|- | |||
| <source lang=apl inline>~</source> | |||
| "not" and "but not" | |||
|- | |||
| <source lang=apl inline>≠</source> | |||
| monadic means "not equal to any preceding item" | |||
|- | |||
| <source lang=apl inline>⍴</source> | |||
| shape and reshape | |||
|- | |||
| <source lang=apl inline>⍳</source> | |||
| indices of and index of | |||
|- | |||
| <source lang=apl inline>⌽</source> | |||
| rotate and mirror along last axis | |||
|- | |||
| <source lang=apl inline>⊖</source> | |||
| rotate and mirror along first axis | |||
|- | |||
| <source lang=apl inline>⍕</source> | |||
| format and format with specification | |||
|} | |||
{{APL development}}{{APL glyphs}} | {{APL development}}{{APL glyphs}} | ||
[[Category:APL character set]] | [[Category:APL character set]] |