Added console-error-port procedure and redirected all error output

to it.
This commit is contained in:
Abdulaziz Ghuloum 2007-12-10 07:40:34 -05:00
parent 0e38534d2e
commit 7fdeade412
7 changed files with 17 additions and 11 deletions

Binary file not shown.

View File

@ -72,8 +72,8 @@ description:
(lambda (con) (lambda (con)
(reset-input-port! (console-input-port)) (reset-input-port! (console-input-port))
(flush-output-port (console-output-port)) (flush-output-port (console-output-port))
(display "Unhandled exception\n" (console-output-port)) (display "Unhandled exception\n" (console-error-port))
(print-condition con (console-output-port)) (print-condition con (console-error-port))
(k (void))) (k (void)))
(lambda () (lambda ()
(display-prompt 0) (display-prompt 0)

View File

@ -29,8 +29,8 @@
(make-parameter (make-parameter
(list (list
(lambda (x) (lambda (x)
(display "Unhandled exception:\n" (standard-error-port)) (display "Unhandled exception:\n" (console-error-port))
(print-condition x) (print-condition x (console-error-port))
(exit -1))))) (exit -1)))))
(define (with-exception-handler handler proc2) (define (with-exception-handler handler proc2)

View File

@ -321,8 +321,7 @@
(void)))) (void))))
(define fasl-write (define fasl-write
(case-lambda (case-lambda
[(x) (fasl-write-to-port x (current-output-port))]
[(x port) [(x port)
(unless (output-port? port) (unless (and (output-port? port) (binary-port? port))
(error 'fasl-write "not an output port" port)) (error 'fasl-write "not an output port" port))
(fasl-write-to-port x port)]))) (fasl-write-to-port x port)])))

View File

@ -32,6 +32,7 @@
current-output-port current-error-port current-output-port current-error-port
open-file-output-port open-file-output-port
console-output-port console-output-port
console-error-port
console-input-port console-input-port
newline newline
input-port-name input-port-name
@ -74,6 +75,7 @@
open-file-output-port open-file-output-port
console-output-port console-output-port
console-input-port console-input-port
console-error-port
newline newline
input-port-name input-port-name
output-port-name output-port-name
@ -1133,6 +1135,10 @@
(let ([p (*the-output-port*)]) (let ([p (*the-output-port*)])
(lambda () p))) (lambda () p)))
(define console-error-port
(let ([p (*the-error-port*)])
(lambda () p)))
(define console-input-port (define console-input-port
(let ([p (*the-input-port*)]) (let ([p (*the-input-port*)])
(lambda () p))) (lambda () p)))

View File

@ -1 +1 @@
1203 1204

View File

@ -345,6 +345,7 @@
[with-output-to-string i] [with-output-to-string i]
[with-output-to-bytevector i] [with-output-to-bytevector i]
[console-input-port i] [console-input-port i]
[console-error-port i]
[console-output-port i] [console-output-port i]
[reset-input-port! i] [reset-input-port! i]
[write-byte i] [write-byte i]
@ -1018,7 +1019,7 @@
[raise-continuable i r ex] [raise-continuable i r ex]
[with-exception-handler i r ex] [with-exception-handler i r ex]
[guard i r ex] [guard i r ex]
[binary-port? r ip] [binary-port? i r ip]
[buffer-mode i r ip] [buffer-mode i r ip]
[buffer-mode? i r ip] [buffer-mode? i r ip]
[bytevector->string r ip] [bytevector->string r ip]
@ -1131,7 +1132,7 @@
[native-eol-style i r ip] [native-eol-style i r ip]
[native-transcoder i r ip] [native-transcoder i r ip]
[transcoder? i] [transcoder? i]
[open-bytevector-input-port r ip] [open-bytevector-input-port i r ip]
[open-bytevector-output-port i r ip] [open-bytevector-output-port i r ip]
[open-file-input-port r ip] [open-file-input-port r ip]
[open-file-input/output-port r ip] [open-file-input/output-port r ip]
@ -1155,8 +1156,8 @@
[standard-input-port i r ip] [standard-input-port i r ip]
[standard-output-port i r ip] [standard-output-port i r ip]
[string->bytevector r ip] [string->bytevector r ip]
[textual-port? r ip] [textual-port? i r ip]
[transcoded-port r ip] [transcoded-port i r ip]
[transcoder-codec i r ip] [transcoder-codec i r ip]
[transcoder-eol-style i r ip] [transcoder-eol-style i r ip]
[transcoder-error-handling-mode i r ip] [transcoder-error-handling-mode i r ip]