Advertisement
Guest User

Untitled

a guest
May 15th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. (setf *images* nil)
  2. (dotimes (x 2) (setf *images* (append *images* (list `(:id ,x
  3. :thumbs nil)))))
  4. *images*
  5. => ((:ID 0 :THUMBS NIL) (:ID 1 :THUMBS NIL))
  6.  
  7. (setf (getf (first *images*) :thumbs) "a")
  8.  
  9. *images*
  10. => ((:ID 0 :THUMBS "a") (:ID 1 :THUMBS "a"))
  11.  
  12. Why is the :thumbs of every plist in *images* set to "a", instead of just the plist retrieved by (first *images*)? How do I get the latter behaviour? This caused a bug which took half an hour to identify...
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement