From: Stas Boukarev Date: Wed, 16 May 2012 22:51:51 +0000 (+0400) Subject: define-condition: return the name of the defined condition. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=d833d62dd152879f1aa4e974bd8337c51905d5ba;p=sbcl.git define-condition: return the name of the defined condition. --- diff --git a/NEWS b/NEWS index dbeaa82..eab39ad 100644 --- a/NEWS +++ b/NEWS @@ -68,6 +68,7 @@ changes relative to sbcl-1.0.56: it's also slightly faster. (lp#998926) * bug fix: better error messages for malformed declarations. (lp#1000239) + * bug fix: define-condition didn't return the name of the defined condition. * documentation: ** improved docstrings: REPLACE (lp#965592) diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 3e7e84e..144062f 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -588,7 +588,8 @@ ;; is a lambda referring to condition slot accessors: ;; they're not proclaimed as functions before it has run if ;; we're under EVAL or loaded as source. - (%set-condition-report ',name ,report)))))) + (%set-condition-report ',name ,report) + ',name))))) ;;;; various CONDITIONs specified by ANSI diff --git a/tests/condition.impure.lisp b/tests/condition.impure.lisp index b66ed3f..9475f9a 100644 --- a/tests/condition.impure.lisp +++ b/tests/condition.impure.lisp @@ -135,3 +135,9 @@ ((slot :initarg :slot :reader ,reader)) (:report (lambda (c stream) (format stream "Oops: ~S" (,reader c)))))))))) + +(with-test (:name :define-condition-result) + (let ((name (gensym "CONDITION"))) + (assert + (eq (eval `(define-condition ,name () ())) + name))))