freenode/#lisp - IRC Chatlog
Search
13:13:42
chrnybo
I've got some plists, want the library yason to encode them as plists, so I've defined an around-method on yason:encode that calls encode-plist when arg is apporpriate, and call-next-method otherwise.
13:23:23
ggole
Write your own generic function that does the plist thing when you want and falls back to yason:encode otherwise?
13:43:19
ggole
Oh right, you won't be able to fall back to yason:encode because it won't call your function on nested parts. It's the open recursion problem again.
13:49:45
loke
chrnybo: doesn't Yason do that? But you should type it as '((:foo . 1) (:bar . #((:zot . 12))))
13:54:52
chrnybo
ggole: I let a flag variable and declared it special, then I check for that flag in my around method. Thus I can leave other users of yason:encode undisturbed.
14:03:59
loke
I thought that it also affects the way it's written. I could be wrong though. It's been a while since I used it.
14:05:40
_death
(com.gigamonkeys.json:json '(:foo 1 :bar #((:zot 12)))) => "{\"foo\":1,\"bar\":[{\"zot\":12}]}"