this post was submitted on 16 Nov 2023
1 points (100.0% liked)

Lisp

53 readers
3 users here now

founded 1 year ago
MODERATORS
 

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?

  1. All original elements of dt are erased. After that, all elements of dt are remade entirely from ground up, elements by elements, excluding the removed value that is 70.
  2. 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.
  3. The original list/vector with 70s loses any association with the variable dt. Then a new list/vector without 70s is assigned to dt.

you are viewing a single comment's thread
view the rest of the comments
[–] 00-11@alien.top 1 points 1 year ago