[alexandria-devel] patch to fix warning

Antony lisp.linux at gmail.com
Fri Dec 10 17:59:38 UTC 2010


Hi

I'd like to submit the following patch to get rid of the warning
       "In PROPER-LIST-LENGTH: Unused lexical variable LAST"

I use Clozure Common Lisp Version 1.4-r13122  (WindowsX8664)

Please check.
Thanks,
-Antony

--- alexandria/lists.lisp       2010-12-10 09:05:44.649536400 -0800
+++ /home/antony/git/thirdparty/alexandria/lists.lisp   2010-12-10 09:25:01.388698100 -0800
@@ -196,7 +196,11 @@
                       (slow (cons (car list) (cdr list)) (cdr slow))
                       ,@(when step (list step)))
                      (nil)
-                  (declare (dynamic-extent slow) ,@(when declare (list declare)))
+                  (declare (dynamic-extent slow)
+                           ,@(when declare
+                                   (if (and (consp declare) (consp (car declare)))
+                                       declare
+                                       (list declare))))
                    (when (safe-endp fast)
                      (return ,ret1))
                    (when (safe-endp (cdr fast))
@@ -209,7 +213,7 @@
      ;; KLUDGE: Most implementations don't actually support lists with bignum
      ;; elements -- and this is WAY faster on most implementations then declaring
      ;; N to be an UNSIGNED-BYTE.
-    (fixnum n)
+    ((ignorable last) (fixnum n))
      (1- n)
      n)







More information about the alexandria-devel mailing list