[slime-cvs] CVS update: slime/slime.el

Luke Gorrie lgorrie at common-lisp.net
Fri Mar 26 16:06:57 UTC 2004


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

Modified Files:
	slime.el 
Log Message:
(slime-group-similar): Bugfix: return NIL if the input list is NIL.

Date: Fri Mar 26 11:06:56 2004
Author: lgorrie

Index: slime/slime.el
diff -u slime/slime.el:1.244 slime/slime.el:1.245
--- slime/slime.el:1.244	Fri Mar 26 08:21:56 2004
+++ slime/slime.el	Fri Mar 26 11:06:56 2004
@@ -2548,12 +2548,14 @@
   "Return the list of lists of 'similar' adjacent elements of LIST.
 The function SIMILAR-P is used to test for similarity.
 The order of the input list is preserved."
-  (let ((accumulator (list (list (car list)))))
-    (dolist (x (cdr list))
-      (if (funcall similar-p x (caar accumulator))
-          (push x (car accumulator))
-        (push (list x) accumulator)))
-    (reverse (mapcar #'reverse accumulator))))
+  (if (null list)
+      nil
+    (let ((accumulator (list (list (car list)))))
+      (dolist (x (cdr list))
+        (if (funcall similar-p x (caar accumulator))
+            (push x (car accumulator))
+          (push (list x) accumulator)))
+      (reverse (mapcar #'reverse accumulator)))))
 
 
 ;;;;; Compiler notes list





More information about the slime-cvs mailing list