From d833d62dd152879f1aa4e974bd8337c51905d5ba Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Thu, 17 May 2012 02:51:51 +0400 Subject: [PATCH] define-condition: return the name of the defined condition. --- NEWS | 1 + src/code/condition.lisp | 3 ++- tests/condition.impure.lisp | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) 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)))) -- 1.7.10.4