Digital encoding of APL symbols explained

The programming language APL uses a number of symbols, rather than words from natural language, to identify operations, similarly to mathematical symbols. Prior to the wide adoption of Unicode, a number of special-purpose EBCDIC and non-EBCDIC code pages were used to represent the symbols required for writing APL.

Character sets

Due to its origins on IBM Selectric-based teleprinters, APL symbols have traditionally been represented on the wire using a unique, non-standard character set. In the 1960s and 1970s, few terminal devices existed which could reproduce them, the most popular ones being the IBM 2741 and IBM 1050 fitted with a specific APL print head. Over time, with the universal use of high-quality graphic display, printing devices and Unicode support, the APL character font problem has largely been eliminated.

Character repertoire

IBM assigns the following character IDs (GCGIDs) to APL syntax, which are used in the definitions of its code pages.

"SL" (APL functional symbol) series GCGIDs!GCGID[1] !! IBM name[2] [3] !! Unicode !! Notes and other mappings
SL010000 Up Stile (APL)
SL020000 Down Stile (APL)
SL030000 Del (APL)
SL040000 Del Tilde (APL)
SL050000 Del Stile (APL)
SL060000 Delta (APL)
SL070000 Delta Stile (APL)
SL080000 Circle (APL) [4] This is SM750000 in a non-APL context, for example, in the C0 replacement graphics from code page 437,[5] which code pages 907, 909 and 910 inherit some or all of, retaining SM750000 in the C0 area and also including SL080000 outside of it. Both map to U+25CB when APL is represented using Unicode characters, although SL080000 can be mapped to U+F890 in IBM's private use area scheme.[6] Compare SL590000 through SL620000 below.
SL090000 Circle Stile (APL)
SL100000 Circle Slope (APL)
SL110000 Circle Star (APL)
SL120000 Circle Bar
SL130000 Quad Quote (APL)
SL140000 Quad Divide (APL)
SL150000 Slash Bar (APL)
SL160000 Slope Bar (APL)
SL170000 Up Caret Tilde (APL)
SL180000 Down Caret Tilde (APL)
SL190000 Down Tack Jot (APL)
SL200000 Up Tack Jot (APL)
SL210000 Up Shoe Null (APL)
SL220000 Up Tack (APL)
SL230000 Down Tack (APL)
SL240000 Down Tack Up Tack (APL)
SL250000 Jot (APL)
SL260000
SL270000 Quad Jot (APL)
SL280000 Quad Slope (APL)
SL290000 Ampersand Underbar Not used in any documented code page. Can be represented in Unicode with the sequence &̲
SL300000 Equal Underbar (APL)
SL310000 OUT Symbol (APL) Not used in any documented code page. Reference glyph resembles oblique underlined forms of the letters O, U and T overstruck in the same character position.
SL320000 Diaeresis Dot (APL)
SL330000 Delta Underbar (APL)
SL340000 Left Tack (APL)
SL350000 Right Tack (APL)
SL360000 Quad (APL)
SL370000 Less Greater (APL) ,
SL380000 Stile (APL) ,
SL400000 Up Shoe (APL)
SL410000 Down Shoe (APL)
SL420000 Left Shoe (APL)
SL430000 Right Shoe (APL)
SL440000 Underbar (APL)
SL450000 Diaeresis (APL)
SL460000 Tilde (APL) U+F88F in IBM's private use area scheme. Also mapped to, although SD190000 (U+007E in a non-APL context) co-occurs at 0xA1 (while SL460000 is at 0x80) in code page 213.
SL480000 Circle Plus
SL490000 Circle x
SL500000 Down Caret (APL)
SL510000 Up Caret (APL)
SL520000 Less (APL)
SL530000 Greater (APL)
SL540000 Divide (APL)
SL550000 Times (APL)
SL560000 Not Greater (APL)
SL570000 Not Less (APL)
SL580000 Quote Dot (APL) U+F88E in IBM's private use area scheme. SP020000 (in a non-APL context) co-occurs at 0x5A in code page 293 (SL580000 is at 0xDB in code pages 293 and 310). Tachyonsoft lists for SL580000.
SL590000 Left Arrow (APL) These arrows are SM300000, SM310000, SM320000 and SM330000 respectively in a non-APL context, for example, in the C0 replacement graphics from code page 437,[7] which code pages 907, 909 and 910 inherit some or all of. Their APL GCGIDs can be mapped to U+F88D, U+F88C, U+F88B and U+F88A respectively in IBM's private use area scheme.

Code pages 907 and 910 keep the non-APL GCGIDs for the C0 replacements but use the APL GCGIDs where the arrows appear outside of the C0 area, while code page 909 uses the APL GCGIDs multiple times, both for the C0 replacements and for between one and two occurrences of each of these arrows outside of the C0 area.

Compare SL080000 above. Duplicating C0 replacement graphics outside of the C0 area is not an uncommon practice in DOS code pages: compare, for example, the pilcrow and section sign in code page 850.

SL600000 Right Arrow (APL)
SL610000 Up Arrow (APL)
SL620000 Down Arrow (APL)
SL630000 Overbar (APL)
SL640000 Slope (APL) U+F889 in IBM's private use area scheme. Also mapped to . SM070000 (in a non-APL context) co-occurs at 0x5A (while SL640000 is at 0xB7) in code page 293.
SL650000 Star (APL)
SL660000 Quote (APL)
SL670000 Left Parenthesis (APL)
SL680000 Right Parenthesis (APL)
SL690000 Bar (APL)
SL700000 Query (APL) U+F888 in IBM's private use area scheme.
SL710000 Alpha (APL)
SL720000 Epsilon (APL) ,
SL730000 Iota (APL)
SL740000 Rho (APL)
SL750000 Omega (APL)
SL760000 Slash (APL)
SL770000 Left Bracket (APL)
SL780000 Right Bracket (APL)
SL790000 Plus (APL)
SL800000 Semicolon (APL)
SL810000 Equal (APL)
SL820000 Not Equal (APL)
SL830000 Colon (APL) Form with fullwidth attribute set (SL830080) is used for 0xA1C3 (i.e.) in EUC-CN.[8]
SL840000 Dot (APL)
SL850000 Comma (APL)
SL860000 Iota Underbar (APL)
SL870000 Epsilon Underbar (APL)

EBCDIC code pages

Code page 293

Code page 293 (CCSID 293),[9] called "APL (USA)", is an EBCDIC code page which includes APL symbols, in addition to preserving the basic Latin letters and Western Arabic numerals at their usual EBCDIC locations.[10]

Code page 310

Code page 310 ("Graphic Escape APL/TN") includes a larger gamut of symbols, but does not itself include the basic Latin letters or the basic digits. It is used alongside Code page 37-2, with the Code page 310 codes being prefixed by the Graphic Escape (EBCDIC 0x08)[11] control character.[12] [13]

Code page 351

Code page 351 ("GDDM Default (USA)") contains most of the characters of Code page 293 and Code page 310 (except , epsilon with underline) in addition to the letters and digits, by replacing several control characters with symbols.

7-bit modified ASCII

Code page 371 (IR-68)

See main article: ISO-IR-68. Code page 371,[14] registered for use with ISO/IEC 2022 as ISO-IR-68,[15] [16] is a 7-bit heavily modified ASCII, designed by the APL Working Group of the Canadian Standards Association, intended for use with APL in an environment allowing overstriking of characters using the (backspace, 0x08) control code.

8-bit modified and/or extended ASCII

Code page 907

Code page 907 is used by the IBM 3812, like code page 906.

Code page 909

Code page 909 is another encoding for APL, differing from code page 907 in not including the underlined characters, assigning different codes to the APL characters which fall in the 0xB0–DF range, and replacing some of the C0 replacement graphics from code page 437 with alternative encodings for certain APL symbols.

Code page 910

Code page 910 is similar to code page 909, but with fewer duplicate horizontal arrows, using the same C0 graphics as code page 437, and including some additional characters.

Unicode

Most APL symbols are present in Unicode, in the Miscellaneous Technical range,[17] although some APL products may not yet feature Unicode, and some APL symbols may be unused or unavailable in a given vendor's implementation.

As of 2010, Unicode allows APL to be stored in text files, published in print and on the web, and shared through email and instant messaging. Entering APL characters still requires the use of either a specific input method editor or keyboard mapping, or of a specific touch interface. APL keyboard mappings are available for free for the most common operating systems, or can be obtained by adding the Unicode APL symbols to existing keyboard map.

Underscored alphabetic characters

Missing from Unicode are the traditional underscored alphabetic characters included in some of the APL code pages; their usage has been eliminated or deprecated in most APL implementations. These were produced on APL printing terminals by over-striking a straight capital letter with an underscore character. Some tables show them simulated with underlined and italic markup, not listing Unicode mappings.

IBM assigns them GCGIDs as "LA480000" (which they name "A Line Below Capital/A Underscore (APL)"), "LB480000" ("B Line Below Capital/B Underscore (APL)") and so forth, under the "L" series used for Latin letters. The use of an even number (48) rather than an odd number (47) is due to being uppercase: compare the use of SD110000 for a lone acute accent, LA110000 for the lowercase, and LA120000 for the uppercase .[18] They are included in IBM's private use area scheme, encoded in reverse‑alphabetical order in the odd-numbered code points from U+F8BF to U+F8F1.[6]

Homologous uses of 47 include the "SD" (diacritic) series GCGID SD470000 for "Line Below/Discontinuous Underscore"[19] —i.e. macron below, distinct from the ASCII underscore which is SP090000 ("Underline/Continuous Underscore")[18] —and the "A" (Arabic letter) series GCGID AD470009 for the ḏāl,[20] for example. Unicode's Latin Extended Additional block includes the following capital "Line Below" characters with the macron below diacritic, for Semitic transcription (it includes a pre-composed ẖ only in lowercase):

However, this does not cover the entire ISO basic Latin alphabet, and IBM's reference glyphs for the APL characters show them both underlined and oblique,[1] and tables simulating them with markup may follow suit. Unicode's Mathematical Alphanumeric Symbols block includes italic characters for use in notations where they are contrastive with non-italic characters. Unicode also includes combining forms of the macron below and underscore in the Combining Diacritical Marks block; the characters above canonically decompose with the former:

Keyboard layout

Note the mnemonics associating an APL character with a letter: (question mark) on, (power) on, (rho) on, (base value) on, (eNcode) on, (modulus) on and so on. This makes it easier for an English-language speaker to type APL on a non-APL keyboard, providing one has visual feedback on one's screen. Also, decals have been produced for attachment to standard keyboards, either on the front of the keys or on the top of them.

Later IBM terminals, notably the IBM 3270 display stations, had an alternate keyboard arrangement which is the basis for some of the modern APL keyboard layouts in use today.

Further APL characters were available by overstriking one character with another. For example, the log symbol (⍟) was formed by overstriking with . This extended the graphic abilities of the earlier teleprinters, but made it more complex to correct errors and edit program lines.

New overstrikes were introduced by vendors as they produced versions of APL tailored to specific hardware, system features, file systems, and so on. Further, printing terminals and early APL cathode-ray terminals were able to display arbitrary overstrikes, but as personal computers rapidly replaced terminals as a data-entry device, APL character support became provided as an APL Character Generator ROM or a soft character set rendered by the display device. With the advent of the modern PC, APL characters were defined in specific fonts, eliminating the distinction between overstruck characters and standard characters.

Finally, the symbols were ratified in Unicode and given specific code points, with unambiguous interpretations, independently of the graphic font.

See also

External links

Notes and References

  1. Web site: Graphic Escape APL2/TN - 138 (chart) . GCSGID 00963 . IBM.
  2. Web site: Graphic Escape APL2/TN - 138 . GCSGID 00963 . IBM.
  3. Web site: Graphic character identifiers: Specials, APL symbols . dead . https://web.archive.org/web/20160122051352/http://www-01.ibm.com/software/globalization/gcgid/aplsym.html . 2016-01-22 . IBM.
  4. Web site: Dyalog Nomenclature: Functions and Operators . Dyalog - Documentation Centre . Dyalog APL.
  5. Web site: Personal Computer . CPGID 00437 . IBM.
  6. (Included with)
  7. Web site: Personal Computer . CPGID 00437 . IBM.
  8. Web site: IBM Simplified Chinese Graphic Character Set for Extended UNIX Code (EUC) . C-H 3-3220-132 1994-06 . . 1994.
  9. Web site: CCSID 293 information document. https://web.archive.org/web/20160327100212/http://www-01.ibm.com/software/globalization/ccsid/ccsid293.html. 2016-03-27.
  10. Web site: Code Page (CPGID) 00293: APL (USA) . REGISTRY, Graphic Character Sets and Code Pages . 1996 . 1984 . IBM . IBM.
  11. Web site: https://web.archive.org/web/20180911044845/https://www-01.ibm.com/software/globalization/cdra/appendix_g1.html . 2018-09-11 . Appendix G-1. EBCDIC control character definitions. . IBM Globalization . IBM . IBM.
  12. Web site: x3270 Character Set . x3270 Documentation . https://web.archive.org/web/20181110212110/http://x3270.bgp.nu/Charset.html . 2018-11-10.
  13. Web site: Chapter 5. 3270 Display Station and Printer Code Page Charts (§ APL/APL2 Text Feature Code Page) . 3174 Establishment Controller Character Set Reference . GA27-3831-02 . 1990 . 1988 . 3rd . . 5·6.
  14. Web site: Code Page 00371 . https://web.archive.org/web/20150708042225/http://www-03.ibm.com/systems/resources/systems_i_software_globalization_pdf_cp00371z.pdf . dead . 2015-07-08 . IBM.
  15. 68 . APL Character Set for Workspace Interchange . 1983-06-01 . Standards Council of Canada . Standards Council of Canada.
  16. Web site: Unicode.org . 19 June 2017 . ISO-IR-68 to Unicode . Cowan . John . 2004-06-29 . Unicode, Inc.
  17. Web site: The Unicode Standard 5.1 Code Charts: Technical Symbols U+2300-U+23FF . October 12, 2008 . Unicode Standard 5.1 . . https://web.archive.org/web/20081002004650/http://www.unicode.org/charts/PDF/U2300.pdf . 2 October 2008 . live.
  18. Web site: Windows, Latin 1 . CPGID 01252 . IBM.
  19. Web site: OCR B . GCSGID 00969 . IBM.
  20. Web site: Windows, Arabic (PDF) . CPGID 01256 . IBM.