For example, suppose that I have a list/vector of integers named dt
, and I want to remove elements with the value 70
there. In Common Lisp it would be:
(setf dt (remove 70 dt))
My question is, which scenario is actually happening here?
- All original elements of
dt
are erased. After that, all elements ofdt
are remade entirely from ground up, elements by elements, excluding the removed value that is70
. - The only affected elements are those with the value of
70
. Only those elements are modified in any way (in this case removed). All other elements are left untouched at all, except that maybe they ‘change positions’ to fill the place of the removed elements. - The original list/vector with
70
s loses any association with the variabledt
. Then a new list/vector without70
s is assigned todt
.
You must log in or register to comment.