[movitz-cvs] CVS update: movitz/losp/muerte/lists.lisp
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Sun Aug 21 19:00:18 UTC 2005
Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv19209
Modified Files:
lists.lisp
Log Message:
Applied the index type declaration here and there.
Date: Sun Aug 21 21:00:17 2005
Author: ffjeld
Index: movitz/losp/muerte/lists.lisp
diff -u movitz/losp/muerte/lists.lisp:1.11 movitz/losp/muerte/lists.lisp:1.12
--- movitz/losp/muerte/lists.lisp:1.11 Sun Jun 12 23:27:07 2005
+++ movitz/losp/muerte/lists.lisp Sun Aug 21 21:00:16 2005
@@ -9,7 +9,7 @@
;;;; Created at: Tue Dec 5 18:40:11 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
-;;;; $Id: lists.lisp,v 1.11 2005/06/12 21:27:07 ffjeld Exp $
+;;;; $Id: lists.lisp,v 1.12 2005/08/21 19:00:16 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -94,6 +94,7 @@
(fast x (cddr fast)) ;Fast pointer: leaps by 2.
(slow x (cdr slow))) ;Slow pointer: leaps by 1.
(nil)
+ (declare (type (index 2) n))
;; If fast pointer hits the end, return the count.
(when (endp fast) (return n))
(when (endp (cdr fast)) (return (+ n 1)))
@@ -127,10 +128,11 @@
(r list)
(i 0 (+ i 1)))
((atom l) r)
+ (declare (index i))
(if (>= i n) (pop r))))
(defun nthcdr (n list)
- (do ()
+ (do ((n (check-the fixnum n)))
((or (null list) (not (plusp n))) list)
(decf n)
(setf list (cdr list))))
More information about the Movitz-cvs
mailing list