Skip to content

Instantly share code, notes, and snippets.

@marcoheisig
Created February 17, 2021 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoheisig/646de30c95908ef131de71d67e7b176b to your computer and use it in GitHub Desktop.
Save marcoheisig/646de30c95908ef131de71d67e7b176b to your computer and use it in GitHub Desktop.
A functional implementation of plist to alist conversion.
(defun alist-from-plist (plist)
(trivia:match plist
((list) '())
((list* (and key (type symbol)) value rest)
(list* (cons key value) (alist-from-plist rest)))
(_ (error "Not a plist:~%~S~%" plist))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment