Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

int-char

int-char

type: function (subr) 
location: built-in
source file: xlstr.c 
Common LISP compatible: similar
versions: all machines

SYNTAX

(int-char <int> )
        <int>           -       an integer numeric expression

DESCRIPTION

The INT-CHAR function returns a character which is the result of turning the <int> expression into a character. If a <int> cannot be made into a character, an error is signalled. The range that <int> produces a valid character is 0 through 255.

EXAMPLES

(int-char 48)                           ; returns #\0
(int-char 65)                           ; returns #\A
(int-char 97)                           ; returns #\a
(int-char 91)                           ; returns #\[
(int-char 10)                           ; returns #\Newline
(int-char 999)                          ; error - character code out of
                                        ;         range - 999

COMMON LISP COMPATIBILITY: Common LISP specifies that INT-CHAR should return a NIL when there is no valid character for the integer value being passed in. XLISP generates an error in these cases. In some cases it is possible to substitue the CODE-CHAR function for INT-CHAR.

NOTE: Unlike the CHAR-CODE and CHAR-INT functions, CODE-CHAR and INT-CHAR are not identical in use. CODE-CHAR accepts 0..127 for its range and then produces NIL results. INT-CHAR accepts 0..255 for its range and then produces errors.


Go to the first, previous, next, last section, table of contents.