Created
February 20, 2014 14:18
-
-
Save bowbow99/9114585 to your computer and use it in GitHub Desktop.
#xyzzy cons の CAR-TYPE/CDR-TYPE を再帰的に指定する typespec で plist
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
(deftype plist (&optional key-type value-type) | |
(let* ((tail (list value-type nil)) | |
(spec `(or null | |
(cons ,key-type | |
(cons ,@tail))))) | |
(setf (cadr tail) spec) | |
spec)) | |
(si:canonicalize-type '(plist keyword number)) | |
=> #1=(or null (cons keyword (cons number #1#))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment