Deleting a unique plist from a list of plists
- From: drlat <lou@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Jul 2012 19:56:06 +0800
I looped through a list of records (plists actually), displaying them
one at a time. When one needed to be deleted, I intended to use
(push record *records-to-remove*)
to populate *records-to-remove*. However, no records needed to be
removed. Nevertheless, once the loop was finished the following code
automatically ran:
(setf *db* (dolist (record-to-remove *records-to-remove*)
(remove record-to-remove *db* :test #'equal)))
to delete any unwanted records. Since *records-to-remove* was empty, no
records should have been removed. To my surprise this deleted every
record in *db*. Studying CLHS, it seems that for several reasons 'remove
is not going to do what is needed. In fact, can #'equal even be used to
test for a unique plist in a list of plists? I don't understand why any
records were deleted at all.
I had a backup, so no big loss. But I haven't been able to figure out
how to do what needs to be done to make this work properly. Any help
will be appreciated.
--
drlat
.
- Prev by Date: Re: github - https://github.com/evrim/core-server
- Next by Date: Re: Why is CLIM dead?
- Previous by thread: how should I name a macro which adds an item to the end of list?
- Next by thread: Re: Deleting a unique plist from a list of plists
- Index(es):