Define and use UNBOUND-SLOT condition.

This commit is contained in:
jjgarcia 2003-04-10 19:47:56 +00:00
parent 88563164b1
commit 05fa67ad17
4 changed files with 18 additions and 1 deletions

View file

@ -1348,6 +1348,8 @@ ECLS 0.9
destructuring (Thanks to the CMUCL team for maintaining a reasonably
portable LOOP!).
- SLOT-UNBOUND now effectively signals an UNBOUND-SLOT condition.
TODO:
=====

View file

@ -196,6 +196,7 @@ cl_symbols[] = {
{"CDR", CL_ORDINARY, cl_cdr, 1},
{"CEILING", CL_ORDINARY, cl_ceiling, -1},
{"CELL-ERROR", CL_ORDINARY, NULL, -1},
{"CELL-ERROR-NAME", CL_ORDINARY, NULL, -1},
{"CERROR", CL_ORDINARY, cl_cerror, -1},
{"CHAR", CL_ORDINARY, cl_char, 2},
{"CHAR-CODE", CL_ORDINARY, cl_char_code, 1},
@ -832,6 +833,7 @@ cl_symbols[] = {
{"TYPECASE", CL_ORDINARY, NULL, -1},
{"TYPEP", CL_ORDINARY, NULL, -1},
{"UNBOUND-SLOT", CL_ORDINARY, NULL, -1},
{"UNBOUND-SLOT-INSTANCE", CL_ORDINARY, NULL, -1},
{"UNBOUND-VARIABLE", CL_ORDINARY, NULL, -1},
{"UNDEFINED-FUNCTION", CL_ORDINARY, NULL, -1},
{"UNEXPORT", CL_ORDINARY, cl_unexport, -1},

View file

@ -134,7 +134,7 @@
(error "~A is not a slot of ~A" slot-name object))
(defmethod slot-unbound ((class t) object slot-name)
(error "the slot ~A of ~A is unbound" slot-name object))
(error 'slot-unbound :instance object :name slot-name))
))
(boot)

View file

@ -461,6 +461,8 @@ returns with NIL."
(define-condition simple-warning (simple-condition warning)
() (:REPORT simple-condition-printer))
(define-condition style-warning (warning) ())
(define-condition simple-error (simple-condition error) ())
(define-condition storage-condition (serious-condition) ())
@ -520,6 +522,13 @@ returns with NIL."
(format stream "The variable ~S is unbound."
(cell-error-name condition)))))
(define-condition unbound-slot (cell-error)
((instance :INITARG :INSTANCE :READER unbound-slot-instance))
(:REPORT (lambda (condition stream)
(format stream "The slot ~S in the object ~S is unbound."
(cell-error-name condition)
(unbound-slot-instance condition)))))
(define-condition undefined-function (cell-error)
()
(:REPORT (lambda (condition stream)
@ -535,6 +544,10 @@ returns with NIL."
(define-condition floating-point-underflow (arithmetic-error) ())
(define-condition floating-point-inexact (arithmetic-error) ())
(define-condition floating-point-invalid-operation (arithmetic-error) ())
(define-condition abort-failure (control-error) ()
(:REPORT (lambda (c s) (declare (ignore c))
(write-string "Abort failed." s))))