X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-error.lisp;h=288f3e122a7b667f7cc9d7fcf990195701fcb81f;hb=15d6e7c9a2c3234f95dfe278046fa2fee1b0c007;hp=4c8eb83e06eac043c5b7beda7e8a4280f7186a1a;hpb=24bee0f055e15d6ad6b1ef37c5013b462ba2a877;p=sbcl.git diff --git a/src/code/target-error.lisp b/src/code/target-error.lisp index 4c8eb83..288f3e1 100644 --- a/src/code/target-error.lisp +++ b/src/code/target-error.lisp @@ -87,7 +87,7 @@ (defun find-restart-or-control-error (identifier &optional condition) (or (find-restart identifier condition) (error 'simple-control-error - :format-control "No restart ~S is active ~{for ~S~}." + :format-control "No restart ~S is active~@[ for ~S~]." :format-arguments (list identifier condition)))) (defun invoke-restart (restart &rest values) @@ -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))