8.15.0.2
Another JSON I/O for Racket
(require meta-json) | package: meta-json |
This basically provides to-json, and from-json.
1 Example and usage
#lang racket/base (require meta-json) (require output) (dump (from-json (to-json (void)))) (dump (from-json (to-json null))) (dump (from-json (to-json '()))) (dump (from-json (to-json '(11 22 #"apple")))) (dump (from-json (to-json '#(11 22 #"apple"))))
2 Reference
Generates a JSON source string for x.
Parses a recognizable prefix of the string str as an object. Raises exn:fail:read if the string is malformed JSON.
#lang racket/base (require meta-json) (require output) (dump (from-json (to-json '#hash((abc . 777))))) (dump (from-json (to-json '#hash((abc . 777))) #:string-key? #t)) ;;(from-json (to-json (quote #hash((abc . 777))))) ==> #hasheq((abc . 777)) ;;(from-json (to-json (quote #hash((abc . 777)))) #:string-key? #t) ==> #hash(("abc" . 777))