2 Control Sequences
(require ansi-terminal/control) | package: ansi-terminal |
The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a cursor, an instruction to start a new line, or a message that the text has been received.
C0 codes are the range #\nul–#\u001F and the default C0 set was originally defined in ISO 646 (ASCII). C1 codes are the range #\u0080–#\u009F and the default C1 set was originally defined in [ECMA48] (harmonized later with ISO 6429). The ISO/IEC 2022 system of specifying control and graphic characters allows other C0 and C1 sets to be available for specialized applications, but they are rarely used.
For more information, see C0 and C1 control codes (Wikipedia).
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
2.1 Control Sequence Predicates
procedure
(char-c0-code? v) → boolean?
v : any/c
procedure
(char-c1-code? v) → boolean?
v : any/c
procedure
(char-fe-code? v) → boolean?
v : any/c
procedure
(char-fs-code? v) → boolean?
v : any/c
procedure
(char-fp-code? v) → boolean?
v : any/c
procedure
(char-nf-code? v) → boolean?
v : any/c
2.2 C0 Unicode Symbols
Unicode defines a set of Control Pictures is a Unicode block containing characters for graphically representing the C0 control codes, and other control characters.
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
value
procedure
(char-c0-symbol? v) → boolean?
v : any/c
procedure
(c0-symbol c) → (or/c char-c0-symbol? #f)
c : char-c0-code?
> (map (lambda (c) (or (c0-symbol c) c)) (string->list "Hello\r\n\tWorld.")) '(#\H #\e #\l #\l #\o #\␍ #\␊ #\␉ #\W #\o #\r #\l #\d #\.)