[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Tue May 24 06:27:55 UTC 2011


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv12599

Modified Files:
	ChangeLog slime.el 
Log Message:
* slime.el (destructure-case): Fix "`_' not left unused" warnings.
Insert an (ignore) form for empty bodies; this inhibts the
compiler transformation that leads to the spurios warning.  This
has no runtime cost in compiled code, since the compiler
recognizes (ignore) and emits no code for it.
(slime-flatten-tree): Deleted. No longer used.

--- /project/slime/cvsroot/slime/ChangeLog	2011/05/23 22:51:45	1.2193
+++ /project/slime/cvsroot/slime/ChangeLog	2011/05/24 06:27:55	1.2194
@@ -1,3 +1,12 @@
+2011-05-24  Helmut Eller  <heller at common-lisp.net>
+
+	* slime.el (destructure-case): Fix "`_' not left unused" warnings.
+	Insert an (ignore) form for empty bodies; this inhibts the
+	compiler transformation that leads to the spurios warning.  This
+	has no runtime cost in compiled code, since the compiler
+	recognizes (ignore) and emits no code for it.
+	(slime-flatten-tree): Deleted. No longer used.
+
 2011-05-23  Stas Boukarev  <stassats at gmail.com>
 
 	* swank.lisp (sdlb-print-condition): New (or old new)
--- /project/slime/cvsroot/slime/slime.el	2011/05/23 22:51:45	1.1368
+++ /project/slime/cvsroot/slime/slime.el	2011/05/24 06:27:55	1.1369
@@ -689,12 +689,6 @@
 
 (put 'when-let 'lisp-indent-function 1)
 
-(eval-and-compile
-  (defun slime-flatten-tree (tree)
-    (cond ((atom tree) (list tree))
-          (t (append (slime-flatten-tree (car tree))
-                     (slime-flatten-tree (cdr tree)))))))
-
 (defmacro destructure-case (value &rest patterns)
   "Dispatch VALUE to one of PATTERNS.
 A cross between `case' and `destructuring-bind'.
@@ -715,9 +709,9 @@
                          `(t ,@(cdr clause))
                        (destructuring-bind ((op &rest rands) &rest body) clause
                          `(,op (destructuring-bind ,rands ,operands
-                                 ,@(if (memq '_ (slime-flatten-tree rands))
-                                       '((ignore _)))
-                                 . ,body)))))
+                                 . ,(or body 
+                                        '((ignore)) ; suppress some warnings
+                                        ))))))
 		   patterns)
 	 ,@(if (eq (caar (last patterns)) t)
 	       '()
@@ -3053,7 +3047,7 @@
   (let ((location (slime-note.location note)))
     (when location 
       (destructure-case location
-        ((:error _) nil)                 ; do nothing
+        ((:error _))                 ; do nothing
         ((:location file pos _hints)
          (cond ((eq (car file) ':source-form) nil)
                ((eq (slime-note.severity note) :read-error)





More information about the slime-cvs mailing list