Does REMOVE ever return the same sequence in practice?

Can REMOVE return the same sequence in any real Common Lisp implementation? The specification assumes that this is permitted:

The result of the deletion can be shared with the sequence; the result may be identical to the input sequence if there are no elements to be deleted.

SBCL does not seem to do this, for example, but I did only a crude (and possibly insufficient) test, and I wonder 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"
+3
2

. , , . , .

CLISP, , .

[1]> (let ((a "abc")) (eq a (remove #\d a)))

T
+6

, . , , , , - REMOVE, - - , , , .

+1

Source: https://habr.com/ru/post/1705974/


All Articles