- (format stream "~@<~S fell through ~S expression. ~:_Wanted one of ~:S.~:>"
- (type-error-datum condition)
- (case-failure-name condition)
- (case-failure-possibilities condition)))))
+ (format stream "~@<~S fell through ~S expression. ~
+ ~:_Wanted one of ~:S.~:>"
+ (type-error-datum condition)
+ (case-failure-name condition)
+ (case-failure-possibilities condition)))))
+
+(define-condition compiled-program-error (program-error)
+ ((message :initarg :message :reader program-error-message)
+ (source :initarg :source :reader program-error-source))
+ (:report (lambda (condition stream)
+ (format stream "Execution of a form compiled with errors.~%~
+ Form:~% ~A~%~
+ Compile-time error:~% ~A"
+ (program-error-source condition)
+ (program-error-message condition)))))
+
+(define-condition interpreted-program-error
+ (program-error encapsulated-condition)
+ ;; Unlike COMPILED-PROGRAM-ERROR, we don't need to dump these, so
+ ;; storing the original condition and form is OK.
+ ((form :initarg :form :reader program-error-form))
+ (:report (lambda (condition stream)
+ (format stream "~&Evaluation of~% ~S~%~
+ caused error:~% ~A~%"
+ (program-error-form condition)
+ (encapsulated-condition condition)))))