public
Created

A naive implementation of property list merge

  • Download Gist
kvplist-merge
1 2 3 4 5 6 7 8
(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))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.