- (loop for c from 0 to (- j i) always
- (let* ((orig '(a a a a a a a a a a))
- (x (copy-seq orig))
- (y (nsubstitute-if-not 'x (lambda (x)
- (not (eq x 'a))) x
- :start i :end j
- :count c :from-end t)))
- (equal y (nconc (make-list (- j c) :initial-element 'a)
- (make-list c :initial-element 'x)
- (make-list (- 10 j)
- :initial-element 'a))))))))
+ (loop for c from 0 to (- j i) always
+ (let* ((orig '(a a a a a a a a a a))
+ (x (copy-seq orig))
+ (y (nsubstitute-if-not 'x (lambda (x)
+ (not (eq x 'a))) x
+ :start i :end j
+ :count c :from-end t)))
+ (equal y (nconc (make-list (- j c) :initial-element 'a)
+ (make-list c :initial-element 'x)
+ (make-list (- 10 j)
+ :initial-element 'a))))))))
+
+;;; And equally similarly, REMOVE-DUPLICATES misbehaved when given
+;;; :START arguments:
+
+(let ((orig (list 0 1 2 0 1 2 0 1 2 0 1 2)))
+ (assert (equalp (remove-duplicates orig :start 3 :end 9) '(0 1 2 0 1 2 0 1 2)))
+ (assert (equalp (delete-duplicates orig :start 3 :end 9) '(0 1 2 0 1 2 0 1 2))))