JSON transformation
Posted: Fri Jun 03, 2011 3:17 pm
Hello, it's me again about Dragonfly!
While using plugin artfulcode/json.lsp version 2.0 I tried to build a string in json format (lisp->json function). It turned out that I can not pass variables in the expression (or I don't know how to do it).
Example:
So I had to change a bit the file json.lsp (wrapping eval around second element of the pair), for it were able to output correct result:
Is it ok, or I again, as newbie to newlisp, missed something trivial?
While using plugin artfulcode/json.lsp version 2.0 I tried to build a string in json format (lisp->json function). It turned out that I can not pass variables in the expression (or I don't know how to do it).
Example:
Code: Select all
(setq var1 "some value")
(Json:lisp->json '(("var1" var1) ("a" 2) ("var2" '(("b" 3) ("c" (+ 2 2))))))
;; will result in -> { "var1": "var1", "a": 2, "var2": { "b": 3, "c": ["+", 2, 2] } }
Code: Select all
;; -> { "var1": "some value", "a": 2, "var2": { "b": 3, "c": 4 } }