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)
(reset-input-port! (console-input-port))
(flush-output-port (console-output-port))
(display "Unhandled exception\n" (console-output-port))
(print-condition con (console-output-port))
(display "Unhandled exception\n" (console-error-port))
(print-condition con (console-error-port))
(k (void)))
(lambda ()
(display-prompt 0)

View File

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

View File

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

View File

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

View File

@ -1 +1 @@
1203
1204

View File

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