X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Futils.lisp;h=60fedc3f971d4a8fd6b9b2d39471dfcb5350064d;hp=7f307d63d2da32ce1c8a646df1cbd8b68ca432f9;hb=91fd65e6ca4e4d7a9c1e0f8b6d860f55b2107437;hpb=925a29060928f773d4bc7d8e6bdd13c97e0ef65a diff --git a/sql/utils.lisp b/sql/utils.lisp index 7f307d6..60fedc3 100644 --- a/sql/utils.lisp +++ b/sql/utils.lisp @@ -393,4 +393,15 @@ is replaced with replacement. [FROM http://cl-cookbook.sourceforge.net/strings.h when pos do (write-string replacement out) while pos) (unless stream - (get-output-stream-string out)))) \ No newline at end of file + (get-output-stream-string out)))) + + +(defun filter-plist (plist &rest keys-to-remove) + "Returns a copy of the given plist with indicated key-value pairs +removed. keys are searched with #'MEMBER" + (declare (dynamic-extent keys-to-remove)) + (when plist + (loop for (k v . rest) = plist then rest + unless (member k keys-to-remove) + collect k and collect v + while rest)))