#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.497 2004/10/01 02:48:06 cph Exp $
+$Id: runtime.pkg,v 14.498 2004/10/06 18:46:55 cph Exp $
Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology
notification-output-port
output-port-type?
output-port?
+ port-type/char-ready?
+ port-type/discard-char
+ port-type/discretionary-flush-output
+ port-type/flush-output
+ port-type/fresh-line
+ port-type/get-transcript-port
port-type/operation
port-type/operation-names
port-type/operations
+ port-type/peek-char
+ port-type/read-char
+ port-type/read-external-substring
+ port-type/read-substring
+ port-type/read-wide-substring
+ port-type/set-transcript-port
+ port-type/unread-char
+ port-type/write-char
+ port-type/write-external-substring
+ port-type/write-substring
+ port-type/write-wide-substring
port-type?
port/coding
port/copy
#| -*-Scheme-*-
-$Id: ttyio.scm,v 1.19 2004/10/06 13:48:51 cph Exp $
+$Id: ttyio.scm,v 1.20 2004/10/06 18:46:59 cph Exp $
Copyright 1991,1993,1996,1999,2003,2004 Massachusetts Institute of Technology
(define console-input-port)
(define console-output-port)
\f
-(define *exit-on-eof?* #t)
-
(define (operation/read-char port)
(let ((char (generic-io/read-char port)))
(if (eof-object? char)
- (if *exit-on-eof?*
- (begin
- (if (not (nearest-cmdl/batch-mode?))
- (begin
- (fresh-line port)
- (write-string "End of input stream reached." port)))
- (%exit)))
- (maybe-echo-input port char))
+ (begin
+ (if (not (nearest-cmdl/batch-mode?))
+ (begin
+ (fresh-line port)
+ (write-string "End of input stream reached." port)))
+ (%exit)))
+ (maybe-echo-input port char)
char))
(define (operation/read-finish port)
- (fluid-let ((*exit-on-eof?* #f))
- (let loop ()
- (if (input-port/char-ready? port)
- (let ((char (input-port/read-char port)))
- (if (not (eof-object? char))
- (if (char-whitespace? char)
- (begin
- (maybe-echo-input port char)
- (loop))
- (input-port/unread-char port char)))))))
+ (let loop ()
+ (if ((port-type/char-ready? generic-i/o-type) port)
+ (let ((char ((port-type/read-char generic-i/o-type) port)))
+ (if (not (eof-object? char))
+ (if (char-whitespace? char)
+ (begin
+ (maybe-echo-input port char)
+ (loop))
+ ((port-type/unread-char generic-i/o-type) port char))))))
(output-port/discretionary-flush port))
(define (maybe-echo-input port char)