0.7.12.56:
[sbcl.git] / src / compiler / compiler-error.lisp
index 43f90c7..0c5e751 100644 (file)
 (defvar *compiler-error-bailout*
   (lambda () (error "COMPILER-ERROR with no bailout")))
 
-;;; We have a separate COMPILER-ERROR condition to allow us to
-;;; distinguish internal compiler errors from user errors.
-;;; Non-compiler errors put us in the debugger.
+;;; an application programmer's error caught by the compiler
+;;;
+;;; We want a separate condition for application programmer errors so
+;;; that we can distinguish them from system programming errors (bugs
+;;; in SBCL itself). Application programmer errors should be caught
+;;; and turned into diagnostic output and a FAILURE-P return value
+;;; from COMPILE or COMPILE-FILE. Bugs in SBCL itself throw us into
+;;; the debugger.
 (define-condition compiler-error (simple-error) ())
 
 ;;; Signal the appropriate condition. COMPILER-ERROR calls the bailout
          :format-control format-string
          :format-arguments format-args)
   (funcall *compiler-error-bailout*)
-  ;; FIXME: It might be nice to define a BUG or OOPS function for "shouldn't
-  ;; happen" cases like this.
-  (error "internal error, control returned from *COMPILER-ERROR-BAILOUT*"))
-(defun compiler-warning (format-string &rest format-args)
+  (bug "Control returned from *COMPILER-ERROR-BAILOUT*."))
+(defun compiler-warn (format-string &rest format-args)
   (apply #'warn format-string format-args)
   (values))
-(defun compiler-style-warning (format-string &rest format-args)
+(defun compiler-style-warn (format-string &rest format-args)
   (apply #'style-warn format-string format-args)
   (values))
 
@@ -84,7 +87,7 @@
   (:report
    (lambda (condition stream)
      (format stream
-            "~@<~S failure in ~S~@[ at character ~D~]: ~2I~_~A~:>"
+            "~@<~S failure in ~S~@[ at character ~W~]: ~2I~_~A~:>"
             'read
             'compile-file
             (input-error-in-compile-file-position condition)