File: char-to-integer

package info (click to toggle)
scheme9 2025.08.12-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,080 kB
  • sloc: lisp: 16,752; ansic: 11,869; sh: 806; makefile: 237; sed: 6
file content (19 lines) | stat: -rw-r--r-- 724 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
R4RS 6.6  (char->integer char)     ==>  integer
          (integer->char integer)  ==>  char

Given a character, CHAR->INTEGER returns an integer representation
of the character. Given an integer that is the image of a character
under CHAR->INTEGER, INTEGER->CHAR returns that character. These
procedures implement injective order isomorphisms between the set
of characters under the CHAR<=? ordering and some subset of the
integers under the <= ordering. That is, if

     (char<=? a b)  ==>  #t
and  (<= x y)       ==>  #t

and X and Y are in the domain of INTEGER->CHAR, then

     (<= (char->integer a)
         (char->integer b))       ==>  #t
and  (char<=? (integer->char x)
              (integer->char y))  ==>  #t.