X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-error.lisp;h=288f3e122a7b667f7cc9d7fcf990195701fcb81f;hb=5da5805594423a2d2a841b88617fd2c87fc05750;hp=7b8931751acef46b187f0353d47439bbfed4ac61;hpb=b1bc2f2142b25964c60d8a295afe1ecf289cd0c8;p=sbcl.git diff --git a/src/code/target-error.lisp b/src/code/target-error.lisp index 7b89317..288f3e1 100644 --- a/src/code/target-error.lisp +++ b/src/code/target-error.lisp @@ -144,24 +144,15 @@ (list (eval (read *query-io*)))) (defun check-type-error (place place-value type type-string) - (let ((cond (if type-string - (make-condition 'simple-type-error - :datum place - :expected-type type - :format-control - "The value of ~S is ~S, which is not ~A." - :format-arguments (list place - place-value - type-string)) - (make-condition 'simple-type-error - :datum place - :expected-type type - :format-control - "The value of ~S is ~S, which is not of type ~S." - :format-arguments (list place - place-value - type))))) - (restart-case (error cond) + (let ((condition + (make-condition + 'simple-type-error + :datum place-value + :expected-type type + :format-control + "The value of ~S is ~S, which is not ~:[of type ~S~;~:*~A~]." + :format-arguments (list place place-value type-string type)))) + (restart-case (error condition) (store-value (value) :report (lambda (stream) (format stream "Supply a new value for ~S." place))