anchor.diff:                   :key key
                    :start start
                    :end end
  -                 :count count))
  -
  -(defun nsubstitute-if (newitem predicate sequence &key key (start 0) end) ; from-end
  +                 :count count
  +                 :from-end from-end))
  +
  +(defun nsubstitute-if (newitem predicate sequence &key key (start 0) end from-end)
     (unless key (setf key 'identity))
  -  (cond ((and (listp sequence)
  -              (zerop start)
  -              (null end))
  -         (mapcar (lambda (x)
  -                   (if (funcall predicate (funcall key x))
  -                       newitem
  -                       x))
  -                 sequence))
  -        (t (unless end (setf end (length sequence)))
  -           (dotimes (i (- end start))
  -             (when (funcall predicate (funcall key (elt sequence (+ start i))))
  -               (setf (elt sequence (+ start i)) newitem)))
  -           sequence)))
  -
  -(defun nsubstitute-if-not (newitem predicate sequence &key key (start 0) end) ; from-end
  -  (unless key (setf key 'identity))
  -  (cond ((and (listp sequence)
  -              (zerop start)
  -              (null end))
  -         (mapcar (lambda (x)
  -                   (if (not (funcall predicate (funcall key x)))
  -                       newitem
  -                       x))
  -                 sequence))
  -        (t (unless end (setf end (length sequence)))
  -           (dotimes (i (- end start))
  -             (when (not (funcall predicate (funcall key (elt sequence (+ start i)))))
  -               (setf (elt sequence (+ start i)) newitem)))
  -           sequence)))
  -
  -(defun nsubstitute (newitem olditem sequence &key test test-not key (start 0) end) ; from-end
  +  (unless end (setf end (length sequence)))
  +  (cond (from-end
  +         (dotimes (i (- end start))
  +           (when (funcall predicate (funcall key (elt sequence (- end i 1))))
  +             (setf (elt sequence (- end i 1)) newitem))))
  +        (t
  +         (dotimes (i (- end start))
  +           (when (funcall predicate (funcall key (elt sequence (+ start i))))
  +             (setf (elt sequence (+ start i)) newitem)))))
  +  sequence)
  +
  +(defun nsubstitute-if-not (newitem predicate sequence &key key (start 0) end from-end)
  +  (nsubstitute-if newitem (complement predicate) sequence
  +                  :key key
  +                  :start start
  +                  :end end
  +                  :count count
  +                  :from-end from-end))
  +
  +(defun nsubstitute (newitem olditem sequence &key test test-not key (start 0) end from-end)
     (check-test-test-not test test-not)
     (when test-not (setf test (complement test-not)))
     (unless test (setf test 'eql))
  
positive.code:                  result-vector)))
              (t (error "~S is not a subtype of SEQUENCE." result-type))))))
  
  (defun substitute-if (newitem predicate sequence &key key (start 0) end count) ; from-end
    (check-type count (or null integer))
    (unless key (setf key 'identity))
    (cond ((and (listp sequence)
                (zerop start)
                (null end))
           (mapcar (lambda (x)
                     (if (and (funcall predicate (funcall key x))
                              (or (null count)
  
negative.code:         (dolist (e sequence)
            (when (funcall predicate (funcall key e))
              (incf n)))
          (dotimes (i (length sequence))
            (when (funcall predicate (funcall key (elt sequence i)))
              (incf n))))
      n))
  