[slime-cvs] CVS slime

trittweiler trittweiler at common-lisp.net
Thu Sep 20 23:45:10 UTC 2007


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv1474

Modified Files:
	slime.el 
Log Message:

* slime.el (slime-length=, slime-length>): Restore support for
  vectors, as `slime-length=' was already used with strings in
  `slime-parse.el'. This broke extended arglist display.


--- /project/slime/cvsroot/slime/slime.el	2007/09/20 14:59:08	1.873
+++ /project/slime/cvsroot/slime/slime.el	2007/09/20 23:45:10	1.874
@@ -9007,14 +9007,23 @@
 
 ;;;;; Misc.
 
-(defun slime-length= (list n)
-  "Return t if (= (length LIST) N)."
-  (setq list (nthcdr (1- n) list))
-  (and list (null (cdr list))))
+(defun slime-length= (seq n)
+  "Test for whether SEQ contains N number of elements. I.e. it's equivalent
+ to (= (LENGTH SEQ) N), but besides being more concise, it may also be more
+ efficiently implemented."
+  (etypecase seq
+    (list
+     (let ((list seq))
+       (setq list (nthcdr (1- n) list))
+       (and list (null (cdr list)))))
+    (sequence
+     (= (length seq) n))))
 
-(defun slime-length> (list n)
+(defun slime-length> (seq n)
   "Return non-nil if (> (length LIST) N)."
-  (nthcdr n list))
+  (etypecase seq
+    (list (nthcdr n seq))
+    (seq  (> (length seq) n))))
 
 (defun slime-split-string (string &optional separators omit-nulls)
   "This is like `split-string' in Emacs22, but also works in




More information about the slime-cvs mailing list