;;; ********************************************************************** ;;; This code was written as part of the Spice Lisp project at ;;; Carnegie-Mellon University, and has been placed in the public domain. ;;; Spice Lisp is currently incomplete and under active development. ;;; If you want to use this code or any part of Spice Lisp, please contact ;;; Scott Fahlman (FAHLMAN@CMUC). ;;; ********************************************************************** ;;; ;;; Error handling functions for Spice Lisp. ;;; these functions are part of the standard Spice Lisp environment. ;;; ;;; Written by Jim Large ;;; changes made by David McDonald and Walter van Roggen ;;; ;;; ********************************************************************** (proclaim '(ignore ignore)) ;;; Condition-handler-bindings is the binding stack which associates condition ;;; names with handler functions. It is a list of forms ;;; (condition-name . handler-function) where condition name is a symbol, and ;;; handler-function is a function object. (defvar condition-handler-bindings () "The binding stack where condition handlers are stored.") ;;; *Error-output* is the stream object which error messages are sent to. (proclaim '(special *error-output*)) ;;; (DILL 7/28/82) -- I put these in to make this compile with the ;;; new XC. (proclaim '(special *query-io* *trace-output* *terminal-io* *standard-output* *standard-input*)) ;;; Break Loop ;;; All calls to this function should be through the break macro which is in ;;; Error-macros.slisp, and is known to the compiler. ;;; ;;; The first thing internal-break-loop does is evaluate the forms in ;;; *error-cleanup-forms* for side effects. *error-cleanup-forms* is bound ;;; to nil while this happens to prevent disaster. ;;; ;;; Then, we enter an REP loop which is like the top level loop except that ;;; the standard streams are rebound to *terminal-io*, ;;; + ++ & friends are bound to their present values, ;;; *evalhook is BOUND to (), ;;; *error-cleanup-forms* is bound to (), ;;; A handler that throws back to the break loop is bound for all errors, ;;; The symbols '$P and '$G and the form '(RETURN