renamed current-error-handler to error-handler

This commit is contained in:
Abdulaziz Ghuloum 2006-12-02 06:26:05 -05:00
parent cd8fea1a05
commit fa1141b57d
4 changed files with 8 additions and 9 deletions

Binary file not shown.

View File

@ -1,17 +1,17 @@
(let () (let ()
(define with-error-handler (define with-error-handler
(lambda (p thunk) (lambda (p thunk)
(let ([old-error-handler (current-error-handler)]) (let ([old-error-handler (error-handler)])
(dynamic-wind (dynamic-wind
(lambda () (lambda ()
(current-error-handler (error-handler
(lambda args (lambda args
(current-error-handler old-error-handler) (error-handler old-error-handler)
(apply p args) (apply p args)
(apply error args)))) (apply error args))))
thunk thunk
(lambda () (lambda ()
(current-error-handler old-error-handler)))))) (error-handler old-error-handler))))))
(define eval-depth 0) (define eval-depth 0)
@ -30,7 +30,6 @@
(with-error-handler (with-error-handler
(lambda args (lambda args
(reset-input-port! (console-input-port)) (reset-input-port! (console-input-port))
;(display "repl catch\n" (console-output-port))
(apply print-error args) (apply print-error args)
(k (void))) (k (void)))
(lambda () (lambda ()

View File

@ -483,7 +483,7 @@
(error 'display "~s is not an output port" p)) (error 'display "~s is not an output port" p))
(display x p)])) (display x p)]))
(primitive-set! 'print-error print-error) (primitive-set! 'print-error print-error)
(primitive-set! 'current-error-handler (primitive-set! 'error-handler
(make-parameter (make-parameter
(lambda args (lambda args
(apply print-error args) (apply print-error args)
@ -492,8 +492,8 @@
(lambda (x) (lambda (x)
(if (procedure? x) (if (procedure? x)
x x
(error 'current-error-handler "~s is not a procedure" x))))) (error 'error-handler "~s is not a procedure" x)))))
(primitive-set! 'error (primitive-set! 'error
(lambda args (lambda args
(apply (current-error-handler) args)))) (apply (error-handler) args))))

View File

@ -69,7 +69,7 @@
display write print-graph fasl-write printf format print-error display write print-graph fasl-write printf format print-error
read-token read read-token read
error exit call/cc error exit call/cc
current-error-handler error-handler
eval current-eval interpret compile compile-file new-cafe load eval current-eval interpret compile compile-file new-cafe load
system system
expand sc-expand current-expand expand-mode expand sc-expand current-expand expand-mode