ASCII code-point constants grouped under the exported object ascii.
Module object
The module exports only ascii, a known Meta Dict with 102 public fields.
- Use
"ascii" useto import the module's public object, or"ascii.ascii" useto import that object by name. Then access a field asascii.lforascii.aCodeBig. asciihas stack effect(-- object)and pushes the Meta Dict.- For every listed field,
ascii.NAMEhas stack effect(-- codePoint): it consumes no data arguments and pushes oneNat32object. ascii.@NAMEhas stack effect(-- block)and reads the Block without calling it. For example,ascii.@lfreads the Block;ascii.lfcalls it.
Type and naming
Calling any listed field pushes one Nat32 object whose value is unknown during compilation. Its run-time value is the code point listed below.
ascii.lf printStackreportsNat32, while the run-time value is10.- The field itself is Meta and non-Ref-like:
ascii 0fieldIsVirtualreturnsTRUE,fieldIsRefreturnsFALSE, andfieldReadreturns a Block. - Uppercase letters use the
aCodeBigthroughzCodeBignames; lowercase letters useaCodethroughzCode. The field name istilda, nottilde.
Code-point boundary
- Constants are provided for code points
0,7–10,12–13, and32–126. - Code points
1–6,11,14–31, and127have no constants in this module. No constants outside the ASCII range are defined. - The result is a numeric code point, not a Text object or an encoded byte buffer.
Control and spacing
Punctuation and digits
exclamation |
33 (!) |
quote |
34 (") |
grid |
35 (#) |
dollar |
36 ($) |
percent |
37 (%) |
ampersand |
38 (&) |
apostrophe |
39 (') |
openRBr |
40 (() |
closeRBr |
41 ()) |
asterisk |
42 (*) |
plus |
43 (+) |
comma |
44 (,) |
minus |
45 (-) |
dot |
46 (.) |
slash |
47 (/) |
zero |
48 (0) |
one |
49 (1) |
two |
50 (2) |
three |
51 (3) |
four |
52 (4) |
five |
53 (5) |
six |
54 (6) |
seven |
55 (7) |
eight |
56 (8) |
nine |
57 (9) |
colon |
58 (:) |
semicolon |
59 (;) |
less |
60 (<) |
equals |
61 (=) |
greater |
62 (>) |
question |
63 (?) |
at |
64 (@) |
openSBr |
91 ([) |
backSlash |
92 (\) |
closeSBr |
93 (]) |
pow |
94 (^) |
underline |
95 (_) |
backquote |
96 (`) |
openFBr |
123 ({) |
vertical |
124 (|) |
closeFBr |
125 (}) |
tilda |
126 (~) |
Uppercase letters
aCodeBig |
65 (A) |
bCodeBig |
66 (B) |
cCodeBig |
67 (C) |
dCodeBig |
68 (D) |
eCodeBig |
69 (E) |
fCodeBig |
70 (F) |
gCodeBig |
71 (G) |
hCodeBig |
72 (H) |
iCodeBig |
73 (I) |
jCodeBig |
74 (J) |
kCodeBig |
75 (K) |
lCodeBig |
76 (L) |
mCodeBig |
77 (M) |
nCodeBig |
78 (N) |
oCodeBig |
79 (O) |
pCodeBig |
80 (P) |
qCodeBig |
81 (Q) |
rCodeBig |
82 (R) |
sCodeBig |
83 (S) |
tCodeBig |
84 (T) |
uCodeBig |
85 (U) |
vCodeBig |
86 (V) |
wCodeBig |
87 (W) |
xCodeBig |
88 (X) |
yCodeBig |
89 (Y) |
zCodeBig |
90 (Z) |
Lowercase letters
aCode |
97 (a) |
bCode |
98 (b) |
cCode |
99 (c) |
dCode |
100 (d) |
eCode |
101 (e) |
fCode |
102 (f) |
gCode |
103 (g) |
hCode |
104 (h) |
iCode |
105 (i) |
jCode |
106 (j) |
kCode |
107 (k) |
lCode |
108 (l) |
mCode |
109 (m) |
nCode |
110 (n) |
oCode |
111 (o) |
pCode |
112 (p) |
qCode |
113 (q) |
rCode |
114 (r) |
sCode |
115 (s) |
tCode |
116 (t) |
uCode |
117 (u) |
vCode |
118 (v) |
wCode |
119 (w) |
xCode |
120 (x) |
yCode |
121 (y) |
zCode |
122 (z) |
Examples
Selected code points
"String" use
"ascii" use
"control" use
{} Int32 {} [
ascii.lf toString print
", " print
ascii.aCodeBig toString print
", " print
ascii.tilda toString print
0
] "main" exportFunction
Expected Output
10, 65, 126
See also
- String: UTF-8 string views, owned strings, formatting helpers, and text conversion utilities.
- windows/unicode: UTF-8 to zero-terminated UTF-16 conversion helper.