* moved integer->char and char->integer to ikarus.chars

This commit is contained in:
Abdulaziz Ghuloum 2007-05-05 06:36:38 -04:00
parent 3fb2afd604
commit f06b7a2d18
3 changed files with 18 additions and 16 deletions

Binary file not shown.

View File

@ -1,15 +1,32 @@
(library (ikarus chars) (library (ikarus chars)
(export char=? char<? char<=? char>? char>=? char-whitespace? (export char=? char<? char<=? char>? char>=? char-whitespace?
char->integer integer->char
char-alphabetic? char-downcase) char-alphabetic? char-downcase)
(import (import
(except (ikarus) (except (ikarus)
char=? char<? char<=? char>? char>=? char=? char<? char<=? char>? char>=?
integer->char char->integer
char-whitespace? char-alphabetic? char-downcase) char-whitespace? char-alphabetic? char-downcase)
(only (scheme) (only (scheme)
$car $cdr $fx+ $fx- $fixnum->char $char->fixnum $car $cdr $fx+ $fx- $fx<= $fx>= $fixnum->char $char->fixnum
$char= $char< $char<= $char> $char>=)) $char= $char< $char<= $char> $char>=))
(define integer->char
(lambda (n)
(unless (fixnum? n)
(error 'integer->char "~s is not a fixnum" n))
(unless (and ($fx>= n 0)
($fx<= n 255))
(error 'integer->char "~s is out of range[0..255]" n))
($fixnum->char n)))
(define char->integer
(lambda (x)
(unless (char? x)
(error 'char->integer "~s is not a character" x))
($char->fixnum x)))
;;; FIXME: this file is embarrasing ;;; FIXME: this file is embarrasing
(define char=? (define char=?
(let () (let ()

View File

@ -11,21 +11,6 @@
(primitive-set! 'void (primitive-set! 'void
(lambda () (void))) (lambda () (void)))
(primitive-set! 'integer->char
(lambda (n)
(unless (fixnum? n)
(error 'integer->char "~s is not a fixnum" n))
(unless (and ($fx>= n 0)
($fx<= n 255))
(error 'integer->char "~s is out of range[0..255]" n))
($fixnum->char n)))
(primitive-set! 'char->integer
(lambda (x)
(unless (char? x)
(error 'char->integer "~s is not a character" x))
($char->fixnum x)))
(primitive-set! 'gensym? (primitive-set! 'gensym?
(lambda (x) (lambda (x)
(and (symbol? x) (and (symbol? x)