Alexandria 非常适合将简单的 alist 转换为 plist,例如:
> (get-document "flower-photo-with-lytro")
((:|_id| . "flower-photo-with-lytro")
(:|_rev| . "6-eb6d9b71251c167039d3e73d8c0c9a63")
(:TITLE . "flower-photo-with-lytro")
(:AUTHOR . "devnull")
(:TEXT . "hello here is a sample flower .... ")
(:TIME . "3558566236"))
> (alexandria:alist-plist (get-document "flower-photo-with-lytro"))
(:|_id| "flower-photo-with-lytro" :|_rev| "6-eb6d9b71251c167039d3e73d8c0c9a63"
:TITLE "flower-photo-with-lytro" :AUTHOR "devnull"
:TEXT "hello here is a sample flower .... " :TIME "3558566236")
我如何使用 alexandria 来格式化更结构化的 alist,例如
> (invoke-view "hulk" "time")
((:|total_rows| . 2)
(:|offset| . 0)
(:|rows|
((:|id| . "flower-photo-with-lytro")
(:|key| . "3558566236")
(:|value| . "flower-photo-with-lytro"))
((:|id| . "hello-world-in-common-lisp-and-restas")
(:|key| . "3558567019")
(:|value| . "3558567019-hello-world-in-common-lisp-and-restas"))))
获取带有:id、:key 和:value 的plist?