JSON: Difference between revisions

Content added Content deleted
No edit summary
Line 205: Line 205:
</lang>
</lang>


<pre>(ql:quickload '("cl-json"))
<pre>To load "cl-json":
Load 1 ASDF system:
cl-json
; Loading "cl-json"


[{"foo":[1,2,3],"bar":true,"baz":"!"},"quux",0.23529412,4.25]
(json:encode-json
'#( ((foo . (1 2 3)) (bar . t) (baz . #\!))
((:FOO 1 2 3) (:BAR . T) (:BAZ . "!"))
"quux" 4/17 4.25))

(print (with-input-from-string
(s "{\"foo\": [1, 2, 3], \"bar\": true, \"baz\": \"!\"}")
(json:decode-json s)))
</pre>
</pre>

=={{header|Clojure}}==
=={{header|Clojure}}==
Library: [https://github.com/clojure/data.json data.json]
Library: [https://github.com/clojure/data.json data.json]