X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcondition.lisp;h=a4fbb9739033f66f37445ffe58869c8d8c4a33ef;hb=de0a47a2f2b165f34177669bd9499135847b4897;hp=2169ccdb922e02b86f8762e60c879e246d13d616;hpb=90d05e4ae39a451ce13a25f4467d0d280ff49593;p=sbcl.git diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 2169ccd..a4fbb97 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -1101,6 +1101,21 @@ SB-EXT:PACKAGE-LOCKED-ERROR-SYMBOL.")) "No traps are enabled? How can this be?" stream)))))) +(define-condition invalid-array-index-error (type-error) + ((array :initarg :array :reader invalid-array-index-error-array) + (axis :initarg :axis :reader invalid-array-index-error-axis)) + (:report + (lambda (condition stream) + (let ((array (invalid-array-index-error-array condition))) + (format stream "Index ~W out of bounds for ~@[axis ~W of ~]~S, ~ + should be nonnegative and <~W." + (type-error-datum condition) + (when (> (array-rank array) 1) + (invalid-array-index-error-axis condition)) + (type-of array) + ;; Extract the bound from (INTEGER 0 (BOUND)) + (caaddr (type-error-expected-type condition))))))) + (define-condition index-too-large-error (type-error) () (:report