I find the code in an old common lisp book, and try it in lispworks and clozure cl. But both of them cannot run the code. This code is used to remove the pair: (author1 . john)
.
(setf q '((author1 . john) (author2 . tony) (author3 . fred)))
(setf (assoc 'author1 q) nil)
Thanks for your time
You can't manipulate the list in-place, but you can get a new list without the specified key in a functional way and reassign the variable: