Glyph: Difference between revisions

Jump to navigation Jump to search
126 bytes added ,  20:59, 10 September 2022
m
Text replacement - "<source" to "<syntaxhighlight"
No edit summary
m (Text replacement - "<source" to "<syntaxhighlight")
Line 1: Line 1:
Glyphs are the individual characters and symbols used in APL, primarily to represent [[primitive function]]s and [[primitive operator|operators]]. A glyph is distinct from the functionality it represents, and usually has a different name: for example, the [[dyadic]] function [[Take]] is represented with the glyph [[Up Arrow]].
Glyphs are the individual characters and symbols used in APL, primarily to represent [[primitive function]]s and [[primitive operator|operators]]. A glyph is distinct from the functionality it represents, and usually has a different name: for example, the [[dyadic]] function [[Take]] is represented with the glyph [[Up Arrow]].


Most of APL's glyphs cannot be represented in [[wikipedia:ASCII|ASCII]], now considered a "standard" or "basic" character set, but all of them are included in [[Unicode]], as one goal of Unicode was to unify existing character sets. In fact, [[Ken Iverson]] first began using [[Iverson notation|his notation]] before work on ASCII began, and [[APL\360]] was implemented before the modern ASCII standard was published in 1967. Prior to the widespread adoption of Unicode, many [[wikipedia:Digital encoding of APL symbols|special purpose code pages]] were used to represent APL symbols. APLs developed more recently, such as [[NARS2000]] and [[GNU APL]], use Unicode characters to represent glyphs, sometimes supporting several different options for a given glyph. Unicode also offers the possibility of introducing glyphs that could not have been produced on older APL systems: for example, both [[NARS2000]] and [[dzaima/APL]] use <source lang=apl inline>√</source> for the [[Square Root]] and [[Root]] functions.
Most of APL's glyphs cannot be represented in [[wikipedia:ASCII|ASCII]], now considered a "standard" or "basic" character set, but all of them are included in [[Unicode]], as one goal of Unicode was to unify existing character sets. In fact, [[Ken Iverson]] first began using [[Iverson notation|his notation]] before work on ASCII began, and [[APL\360]] was implemented before the modern ASCII standard was published in 1967. Prior to the widespread adoption of Unicode, many [[wikipedia:Digital encoding of APL symbols|special purpose code pages]] were used to represent APL symbols. APLs developed more recently, such as [[NARS2000]] and [[GNU APL]], use Unicode characters to represent glyphs, sometimes supporting several different options for a given glyph. Unicode also offers the possibility of introducing glyphs that could not have been produced on older APL systems: for example, both [[NARS2000]] and [[dzaima/APL]] use <syntaxhighlight lang=apl inline>√</source> for the [[Square Root]] and [[Root]] functions.


While [[Iverson notation]] was originally handwritten, the choice of glyphs to include in the first APL implementations was influenced by technical constraints of the typewriters used at the time. Notably, many glyphs were produced by overlaying two simpler glyphs, a technique known as [[overstrike|overstriking]]. The original glyph shapes in [[A Programming Language]] were drawn by [[Ken Iverson]]'s wife, Jean Iverson, using a [[wikipedia:Keuffel and Esser|Keuffel and Esser]] Leroy [[wikipedia:Technical_lettering#Mechanical_lettering|lettering set]].<ref>[[Roger Hui]]. [https://www.jsoftware.com/papers/APLQA.htm#Jean_Iverson APL Quotations and Anecdotes]. [[J]]software.</ref>
While [[Iverson notation]] was originally handwritten, the choice of glyphs to include in the first APL implementations was influenced by technical constraints of the typewriters used at the time. Notably, many glyphs were produced by overlaying two simpler glyphs, a technique known as [[overstrike|overstriking]]. The original glyph shapes in [[A Programming Language]] were drawn by [[Ken Iverson]]'s wife, Jean Iverson, using a [[wikipedia:Keuffel and Esser|Keuffel and Esser]] Leroy [[wikipedia:Technical_lettering#Mechanical_lettering|lettering set]].<ref>[[Roger Hui]]. [https://www.jsoftware.com/papers/APLQA.htm#Jean_Iverson APL Quotations and Anecdotes]. [[J]]software.</ref>
Line 10: Line 10:


=== Bi-glyphs ===
=== Bi-glyphs ===
J and K use both ASCII symbols on their own, and followed by one or more periods and/or colons. J terminology calls these ''bigraphs'' and ''trigraphs''. For example, J uses <source lang=j inline>^</source> for [[Power]], <source lang=j inline>^.</source> for [[Logarithm]], and <source lang=j inline>^:</source> for the [[Power operator]], while K uses <code>':</code> for the equivalent of [[Windowed_Reduce#Notable_uses|pair-wise reduction]] (<source lang=apl inline>¯2f/</source>) and <code>0:</code> for line-by-line file read/write. Lately, J has gone beyond this and added <source lang=j inline>{{</source>…<source lang=j inline>}}</source> for explicit functions, similar to the syntax of [[dfns]].
J and K use both ASCII symbols on their own, and followed by one or more periods and/or colons. J terminology calls these ''bigraphs'' and ''trigraphs''. For example, J uses <syntaxhighlight lang=j inline>^</source> for [[Power]], <syntaxhighlight lang=j inline>^.</source> for [[Logarithm]], and <syntaxhighlight lang=j inline>^:</source> for the [[Power operator]], while K uses <code>':</code> for the equivalent of [[Windowed_Reduce#Notable_uses|pair-wise reduction]] (<syntaxhighlight lang=apl inline>¯2f/</source>) and <code>0:</code> for line-by-line file read/write. Lately, J has gone beyond this and added <syntaxhighlight lang=j inline>{{</source>…<syntaxhighlight lang=j inline>}}</source> for explicit functions, similar to the syntax of [[dfns]].


[[Dyalog APL]] uses a few bi-glyphs, especially in dops (the operand equivalent of a dfn) where for example <source lang=apl inline>⍺⍺</source> and <source lang=apl inline>⍵⍵</source> denote the left and right [[operand]]s. [[GNU APL]] and [[dzaima/APL]] use <source lang=apl inline>⍶</source> and <source lang=apl inline>⍹</source> instead.
[[Dyalog APL]] uses a few bi-glyphs, especially in dops (the operand equivalent of a dfn) where for example <syntaxhighlight lang=apl inline>⍺⍺</source> and <syntaxhighlight lang=apl inline>⍵⍵</source> denote the left and right [[operand]]s. [[GNU APL]] and [[dzaima/APL]] use <syntaxhighlight lang=apl inline>⍶</source> and <syntaxhighlight lang=apl inline>⍹</source> instead.


[[GNU APL]] also uses bi-glyphs consisting of <source lang=apl inline>⊤</source> follwed by a comparison function as the bit-wise equivalent of the comparison function. For example <source lang=apl inline>A⊤∧B</source> is bit-wise [[And]]. [[Number]]s are treated as 64-bit integers, and [[character]]s as 32-bit integers (with the result being character as well).
[[GNU APL]] also uses bi-glyphs consisting of <syntaxhighlight lang=apl inline>⊤</source> follwed by a comparison function as the bit-wise equivalent of the comparison function. For example <syntaxhighlight lang=apl inline>A⊤∧B</source> is bit-wise [[And]]. [[Number]]s are treated as 64-bit integers, and [[character]]s as 32-bit integers (with the result being character as well).


[[NARS2000]] uses <source lang=apl inline>..</source> for its [[Range]] function.
[[NARS2000]] uses <syntaxhighlight lang=apl inline>..</source> for its [[Range]] function.
== References ==
== References ==
<references/>
<references/>

Navigation menu