X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcondition.lisp;h=a4fbb9739033f66f37445ffe58869c8d8c4a33ef;hb=de0a47a2f2b165f34177669bd9499135847b4897;hp=830721dde4b4843dd0f2140fdecf5bafd1a4d950;hpb=56d318ce89dd0c1cff3fd210691ac0367b1382e3;p=sbcl.git diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 830721d..a4fbb97 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -648,6 +648,11 @@ "end of file on ~S" (stream-error-stream condition))))) +(define-condition closed-stream-error (stream-error) () + (:report + (lambda (condition stream) + (format stream "~S is closed" (stream-error-stream condition))))) + (define-condition file-error (error) ((pathname :reader file-error-pathname :initarg :pathname)) (:report @@ -903,6 +908,9 @@ (define-condition simple-reference-error (reference-condition simple-error) ()) +(define-condition simple-reference-warning (reference-condition simple-warning) + ()) + (define-condition duplicate-definition (reference-condition warning) ((name :initarg :name :reader duplicate-definition-name)) (:report (lambda (c s) @@ -1093,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 @@ -1177,6 +1200,14 @@ SB-EXT:PACKAGE-LOCKED-ERROR-SYMBOL.")) (simple-condition-format-arguments condition) (reader-impossible-number-error-error condition)))))) +(define-condition standard-readtable-modified-error (reference-condition error) + ((operation :initarg :operation :reader standard-readtable-modified-operation)) + (:report (lambda (condition stream) + (format stream "~S would modify the standard readtable." + (standard-readtable-modified-operation condition)))) + (:default-initargs :references `((:ansi-cl :section (2 1 1 2)) + (:ansi-cl :glossary "standard readtable")))) + (define-condition timeout (serious-condition) ((seconds :initarg :seconds :initform nil :reader timeout-seconds)) (:report (lambda (condition stream)