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
(defmethod yason:encode :around ((object list) &optional (stream *standard-output*)) | |
"If *lists-as-plists*, encode OBJECT as plist | |
if object satisfies #'plistp and every key is a keyword. | |
Otherwise encode as list." | |
(if (and (boundp '*lists-as-plists*) | |
*lists-as-plists* | |
(system:plistp object) | |
(loop for key in object by 'cddr | |
always (keywordp key))) | |
(yason:encode-plist object stream) |