Created
July 16, 2013 21:50
-
-
Save PuercoPop/6015465 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun merge-plists (list-a list-b) | |
"If a key from list-b does not exist in list-a add it to it." | |
(let ((*merged-list* (copy-list list-a))) | |
(declare (special *merged-list*)) | |
(loop for key in list-b by #'cddr | |
do | |
(unless (getf list-a key) | |
(setf *merged-list* (append *merged-list* `(,key ,(getf list-b key)))))) | |
*merged-list*)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment