#| -*-Scheme-*-
-$Id: char.scm,v 14.30 2007/01/05 21:19:28 cph Exp $
+$Id: char.scm,v 14.31 2007/08/10 17:57:25 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(guarantee-char char 'CLEAR-CHAR-BITS)
(%make-char (%char-code char)
(fix:andc (%char-bits char) bits)))
+\f
+(define (8-bit-char? object)
+ (and (char? object)
+ (fix:< (char->integer char) 256)))
+
+(define (guarantee-8-bit-char object #!optional caller)
+ caller
+ (error:not-8-bit-char object))
(define (char-ascii? char)
(guarantee-char char 'CHAR-ASCII?)
n)))
(define (char->ascii char)
- (guarantee-char char 'CHAR->ASCII)
- (let ((n (char->integer char)))
- (if (not (fix:< n 256))
- (error:bad-range-argument char 'CHAR->ASCII))
- n))
+ (guarantee-8-bit-char char 'CHAR->ASCII)
+ (char->integer char))
(define (ascii->char code)
(guarantee-limited-index-fixnum code 256 'ASCII->CHAR)
#| -*-Scheme-*-
-$Id: port.scm,v 1.50 2007/01/09 06:16:53 cph Exp $
+$Id: port.scm,v 1.51 2007/08/10 17:57:26 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(define (error:not-i/o-port port caller)
(error:wrong-type-argument port "I/O port" caller))
-
-(define-integrable (guarantee-8-bit-char char)
- (if (fix:>= (char->integer char) #x100)
- (error:not-8-bit-char char)))
\f
(define (port/supports-coding? port)
(let ((operation (port/operation port 'SUPPORTS-CODING?)))
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.620 2007/07/07 17:22:19 cph Exp $
+$Id: runtime.pkg,v 14.621 2007/08/10 17:57:27 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(files "char")
(parent (runtime))
(export ()
+ 8-bit-char?
ascii->char
char->ascii
char->digit
digit->char
error:not-char
error:not-radix
+ guarantee-8-bit-char
guarantee-char
guarantee-radix
integer->char
close-port
current-input-port
current-output-port
- guarantee-8-bit-char
guarantee-i/o-port
guarantee-input-port
guarantee-output-port