Improved handling of quoted symbols in CASE.
authorTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2008 05:57:56 +0000 (05:57 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2008 05:59:22 +0000 (05:59 +0000)
(case val ('a (b)))      ; now produces an error, just like:
(case val (('a 'b) (c))) ; did before.

Thanks to: Daniel Gackle <danielgackle@gmail.com>

src/special-forms.lisp

index 155ce51..49f0650 100644 (file)
 
 (defpsmacro case (value &rest clauses)
   (labels ((make-clause (val body more)
-             (cond ((listp val)
+             (cond ((and (listp val) (not (eq (car val) 'quote)))
                     (append (mapcar #'list (butlast val))
                             (make-clause (first (last val)) body more)))
                    ((member val '(t otherwise))