Jump to content

JSON: Difference between revisions

583 bytes added ,  11 years ago
no edit summary
(added required package for the code to work)
No edit summary
Line 190:
</lang>
 
=={{header|Common Lisp}}=
Library: [https://github.com/hankhero/cl-json cl-json]
<lang lisp>
(ql:quickload '("cl-json"))
 
(json:encode-json
'#( ((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)))
 
</lang>
 
<pre>(ql:quickload '("cl-json"))
 
(json:encode-json
'#( ((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>
=={{header|Clojure}}==
Library: [https://github.com/clojure/data.json data.json]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.