define-condition: return the name of the defined condition.
authorStas Boukarev <stassats@gmail.com>
Wed, 16 May 2012 22:51:51 +0000 (02:51 +0400)
committerStas Boukarev <stassats@gmail.com>
Wed, 16 May 2012 22:51:51 +0000 (02:51 +0400)
NEWS
src/code/condition.lisp
tests/condition.impure.lisp

diff --git a/NEWS b/NEWS
index dbeaa82..eab39ad 100644 (file)
--- 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)
 
index 3e7e84e..144062f 100644 (file)
            ;; 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)))))
 \f
 ;;;; various CONDITIONs specified by ANSI
 
index b66ed3f..9475f9a 100644 (file)
                  ((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))))