From 57fe836373e2ecb56e6d497320b01c83447a01fc Mon Sep 17 00:00:00 2001 From: Jan Moringen Date: Tue, 5 Mar 2013 19:46:01 +0100 Subject: [PATCH] Declare types of END and TEST in N{LIST,VECTOR}-SUBSTITUTE-IF[-NOT]* The types of END and TEST are known because the respective callers are defined with DEFINE-SEQUENCE-TRAVERSER which checks/COERCEs appropriately. --- src/code/seq.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/code/seq.lisp b/src/code/seq.lisp index 12fa573..f2f9cd4 100644 --- a/src/code/seq.lisp +++ b/src/code/seq.lisp @@ -2180,7 +2180,8 @@ many elements are copied." (apply #'sb!sequence:nsubstitute-if new predicate sequence args))) (defun nlist-substitute-if* (new test sequence start end count key) - (declare (fixnum end)) + (declare (type fixnum end) + (type function test)) ; coercion is done by caller (do ((list (nthcdr start sequence) (cdr list)) (index start (1+ index))) ((or (= index end) (null list) (= count 0)) sequence) @@ -2190,6 +2191,8 @@ many elements are copied." (defun nvector-substitute-if* (new test sequence incrementer start end count key) + (declare (type fixnum end) + (type function test)) ; coercion is done by caller (do ((index start (+ index incrementer))) ((or (= index end) (= count 0)) sequence) (when (funcall test (apply-key key (aref sequence index))) @@ -2223,7 +2226,8 @@ many elements are copied." (apply #'sb!sequence:nsubstitute-if-not new predicate sequence args))) (defun nlist-substitute-if-not* (new test sequence start end count key) - (declare (fixnum end)) + (declare (type fixnum end) + (type function test)) ; coercion is done by caller (do ((list (nthcdr start sequence) (cdr list)) (index start (1+ index))) ((or (= index end) (null list) (= count 0)) sequence) @@ -2233,6 +2237,8 @@ many elements are copied." (defun nvector-substitute-if-not* (new test sequence incrementer start end count key) + (declare (type fixnum end) + (type function test)) ; coercion is done by caller (do ((index start (+ index incrementer))) ((or (= index end) (= count 0)) sequence) (when (not (funcall test (apply-key key (aref sequence index)))) -- 1.7.10.4