Created
February 17, 2021 12:02
-
-
Save marcoheisig/646de30c95908ef131de71d67e7b176b to your computer and use it in GitHub Desktop.
A functional implementation of plist to alist conversion.
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 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