+(define-condition bounding-indices-bad-error (type-error)
+ ((object :reader bounding-indices-bad-object :initarg :object))
+ (:report
+ (lambda (condition stream)
+ (let* ((datum (type-error-datum condition))
+ (start (car datum))
+ (end (cdr datum))
+ (object (bounding-indices-bad-object condition)))
+ (etypecase object
+ (sequence
+ (format stream
+ "The bounding indices ~S and ~S are bad for a sequence of length ~S."
+ start end (length object)))
+ (array
+ ;; from WITH-ARRAY-DATA
+ (format stream
+ "The START and END parameters ~S and ~S are bad for an array of total size ~S."
+ start end (array-total-size object))))))))
+
+(define-condition nil-array-accessed-error (type-error)
+ ()
+ (:report (lambda (condition stream)
+ (format stream
+ "An attempt to access an array of element-type ~
+ NIL was made. Congratulations!"))))
+