diff --git a/src/ikarus.boot b/src/ikarus.boot index 73f032d..ee21372 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.chars.ss b/src/ikarus.chars.ss index 49a5ad7..e8ca7bb 100644 --- a/src/ikarus.chars.ss +++ b/src/ikarus.chars.ss @@ -1,15 +1,32 @@ (library (ikarus chars) (export char=? char? char>=? char-whitespace? + char->integer integer->char char-alphabetic? char-downcase) (import (except (ikarus) char=? char? char>=? + integer->char char->integer char-whitespace? char-alphabetic? char-downcase) (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>=)) + (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 (define char=? (let () diff --git a/src/ikarus.core.ss b/src/ikarus.core.ss index f96ddaa..c9a1073 100644 --- a/src/ikarus.core.ss +++ b/src/ikarus.core.ss @@ -11,21 +11,6 @@ (primitive-set! '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? (lambda (x) (and (symbol? x)