Count, if supplied, limits the number of elements altered; if more than countelementssatisfy the test, then of these elements only the leftmost or rightmost, depending on from-end, are replaced, as many as specified by count. If count is supplied and negative, the behavior is as if zero had been supplied instead. If count is nil, all matching items are affected.

Supplying a from-end of true matters only when the count is provided (and non-nil); in that case, only the rightmost countelementssatisfying the test are removed (instead of the leftmost).

predicate, test, and test-not might be called more than once for each sequenceelement, and their side effects can happen in any order.

The result of all these functions is a sequence of the same type as sequence that has the same elements except that those in the subsequence bounded by start and end and satisfying the test have been replaced by newitem.

Because the side-effecting variants (e.g., nsubstitute) potentially change the path that is being traversed, their effects in the presence of shared or circular structure may vary in surprising ways when compared to their non-side-effecting alternatives. To see this, consider the following side-effect behavior, which might be exhibited by some implementations: