Commit 540b5895 authored by Gail Zacharias's avatar Gail Zacharias

Smarter stringify-plist, add unstringify-plist

parent 3f2b1195
......@@ -235,7 +235,18 @@
(defun stringify-plist (plist)
(loop for (key val) on plist by #'cddr
collect key
collect (if (and val (symbolp val)) (format nil "~s" val) val)))
collect (cond ((or (null val) (eql val t) (numberp val)) val)
((atom val) (format nil "~s" val))
((keywordp (car val)) (stringify-plist val))
(t (mapcar #'stringify-plist val)))))
(defun unstringify-plist (plist)
(loop for (key val) on plist by #'cddr
collect key
collect (cond ((or (null val) (eql val t)) val)
((atom val) (read-safe-string val))
((keywordp (car val)) (unstringify-plist val))
(t (mapcar #'unstringify-plist val)))))
(defmethod encode-for-http ((item t)) item)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment