* Fix it, write some tests as penance.
(setf pointer (nthcdr (1- start) pointer)))
(if pointer
(pop pointer)
- (oops))
- (if end
- (let ((n (- end start)))
- (declare (integer n))
- (when (minusp n)
- (oops))
- (when (plusp n)
- (loop repeat n
- do (rplaca pointer item))))
- (loop while pointer
- do (setf pointer (cdr (rplaca pointer item)))))))))
+ (oops)))
+ (if end
+ (let ((n (- end start)))
+ (declare (integer n))
+ (when (minusp n)
+ (oops))
+ (when (plusp n)
+ (loop repeat n
+ do (setf pointer (cdr (rplaca pointer item))))))
+ (loop while pointer
+ do (setf pointer (cdr (rplaca pointer item))))))))
(defun vector-fill* (sequence item start end)
(with-array-data ((data sequence)
(delete-duplicates (vector #\a #\b #\c #\a)
:test-not (lambda (a b) (not (char-equal a b))))
+
+;;; FILL on lists
+(let ((l (list 1 2 3)))
+ (fill l 0 :start 1 :end 2)
+ (assert (equal l '(1 0 3)))
+ (fill l 'x :start 2 :end 3)
+ (assert (equal l '(1 0 x)))
+ (fill l 'y :start 1)
+ (assert (equal l '(1 y y)))
+ (fill l 'z :end 2)
+ (assert (equal l '(z z y)))
+ (fill l 1)
+ (assert (equal l '(1 1 1)))
+ (assert (raises-error? (fill l 0 :start 4)))
+ (assert (raises-error? (fill l 0 :end 4)))
+ (assert (raises-error? (fill l 0 :start 2 :end 1))))
\f
;;; success
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.12.26"
+"1.0.12.27"