[slime-devel] patch to destructure-case

Matthew D Swank akopa at charter.net
Fri Jun 30 22:22:24 EDT 2006


Would it be possible to have destructure-case match against arbitrary,
non-nil atoms (patch attached)?

Matt
-- 
"You do not really understand something unless you can explain it to
your grandmother." — Albert Einstein.
-------------- next part --------------
--- slime/swank.lisp.orig	2006-06-18 13:21:54.000000000 -0500
+++ slime/swank.lisp	2006-06-30 21:14:27.000000000 -0500
@@ -304,8 +304,8 @@
 	    (,operands (cdr ,tmp)))
        (case ,operator
          ,@(loop for (pattern . body) in patterns collect 
-                   (if (eq pattern t)
-                       `(t , at body)
+                   (if (and pattern (atom pattern))
+                       `(,pattern , at body)
                        (destructuring-bind (op &rest rands) pattern
                          `(,op (destructuring-bind ,rands ,operands 
                                  , at body)))))


More information about the slime-devel mailing list