Commit d7c7fc6b authored by ram's avatar ram
Browse files

Fixed COUNT :TEST-NOT to actually negate the test.

parent 37eb7306
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/seq.lisp,v 1.14 1993/08/25 01:15:00 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/seq.lisp,v 1.15 1993/11/02 16:12:54 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -2028,10 +2028,11 @@ ...@@ -2028,10 +2028,11 @@
((= index (the fixnum end)) count) ((= index (the fixnum end)) count)
(declare (fixnum index count)) (declare (fixnum index count))
(if test-not (if test-not
(if (funcall test-not ,item (apply-key key (aref ,sequence index))) (unless (funcall test-not ,item
(setq count (1+ count))) (apply-key key (aref ,sequence index)))
(if (funcall test ,item (apply-key key (aref ,sequence index))) (setq count (1+ count)))
(setq count (1+ count)))))) (when (funcall test ,item (apply-key key (aref ,sequence index)))
(setq count (1+ count))))))
(defmacro list-count (item sequence) (defmacro list-count (item sequence)
`(do ((sequence (nthcdr start ,sequence)) `(do ((sequence (nthcdr start ,sequence))
...@@ -2040,10 +2041,10 @@ ...@@ -2040,10 +2041,10 @@
((or (= index (the fixnum end)) (null sequence)) count) ((or (= index (the fixnum end)) (null sequence)) count)
(declare (fixnum index count)) (declare (fixnum index count))
(if test-not (if test-not
(if (funcall test-not ,item (apply-key key (pop sequence))) (unless (funcall test-not ,item (apply-key key (pop sequence)))
(setq count (1+ count))) (setq count (1+ count)))
(if (funcall test ,item (apply-key key (pop sequence))) (when (funcall test ,item (apply-key key (pop sequence)))
(setq count (1+ count)))))) (setq count (1+ count))))))
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment