0.7.13.21:
[sbcl.git] / src / code / condition.lisp
index 1e5c7c7..99375b4 100644 (file)
             "The function ~S is undefined."
             (cell-error-name condition)))))
 
+(define-condition special-form-function (undefined-function) ()
+  (:report
+   (lambda (condition stream)
+     (format stream
+            "Cannot FUNCALL the SYMBOL-FUNCTION of special operator ~S."
+            (cell-error-name condition)))))
+
 (define-condition arithmetic-error (error)
   ((operation :reader arithmetic-error-operation
              :initarg :operation
             "The index ~S is too large."
             (type-error-datum condition)))))
 
-;;; Out-of-range &KEY END arguments are similar to, but off by one
-;;; from out-of-range indices into the sequence.
-(define-condition index-too-large-error (type-error)
-  ()
+(define-condition bounding-indices-bad-error (type-error)
+  ((object :reader bounding-indices-bad-object :initarg :object))
   (:report
    (lambda (condition stream)
-     (format stream
-            "The end-of-sequence specifier ~S is too large."
-            (type-error-datum condition)))))
+     (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!"))))
 
 (define-condition io-timeout (stream-error)
   ((direction :reader io-timeout-direction :initarg :direction))