Fundamentals of CS I (CS151 2001S) : Reference

integer->char - determine the collating sequence number of a character

Procedurechar->integer
Parametersi, an integer
PurposeReturns character i of the collating sequence used for characters in the particular implementation of scheme.
Producesc, the corresponding character.
PreconditionsOnly one parameter (verified).
i is an integer (verified).
i is within the range of valid sequence numbers for the given implementation (verfied).
PostconditionsThe result is an integer in the range of valid collating sequence numbers.
(char->integer c) is i.
Examples
> (char->integer #\t)
116
> (integer->char (+ (char->integer #\a) 2))
#\c
> (integer->char (+ (char->integer #\A) 2))
#\C
> (integer->char 10000)
integer->char: expects argument of type <exact in [0, 255]>; given 10000
> (integer->char #\a)
integer->char: expects argument of type <exact in [0, 255]>; given #\a
See Also
  char->integer

Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This page was generated by Siteweaver on Thu Feb 22 05:48:02 2001.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2001S/integer-to-char.html.
You may validate this page's HTML.
The source was last modified Sun Feb 4 20:57:03 2001.