Michael Weber michaelw+alexandria@foldr.org writes:
Below are three different implementations of remove-from-plist, all of which I find more aestetic than current alexandria's implementation. YMMV.
I would favor the first one, which explicitly ditches error checking ("it's user responsibility", and a proper plist will be returned).
What about using Alexandria's DOPLIST which does the error checking for us?
-T.
(defun remove-from-plist (plist &rest keys) (let (result) (doplist (k v plist (nreverse result)) (unless (member k keys :test #'eq) (push k result) (push v result)))))