Does REMOVE ever return the same sequence in any real implementations of Common Lisp? The spec suggests that it is allowed:
The result of remove may share with sequence; the result may be identical to the input sequence if no elements need to be removed.
SBCL does not seem to do this, for example, but I only did a crude (and possibly insufficient) test, and I'm wondering what other implementations do.
CL-USER> (defparameter *str* "bbb") *STR* CL-USER> *str* "bbb" CL-USER> (defparameter *str2* (remove #\a *str*)) *STR2* CL-USER> (eq *str* *str2*) NIL CL-USER> *str* "bbb" CL-USER> *str2* "bbb"