Created
January 22, 2013 14:29
-
-
Save spacebat/4595042 to your computer and use it in GitHub Desktop.
A naive implementation of property list merge
This file contains 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* kvplist-merge (&rest plists) | |
"Merge the 2nd and subsequent plists into the first, clobbering values set by lists to the left." | |
(let ((result (car plists)) | |
(plists (cdr plists))) | |
(loop for plist in plists do | |
(loop for (key val) on plist by 'cddr do | |
(setq result (plist-put result key val)))) | |
result)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment