(index ("string->cjson" 0) ("string->cjson*" 338) ("cjson->string" 735) ("cjson-schemify" 1081) ("string->json" 1387) ("cjson-type" 1837) ("cjson-int" 2299) ("cjson-double" 2299) ("cjson-string" 2299) ("cjson-key" 2299) ("cjson-array-ref" 3055) ("cjson-obj-ref" 3300))
(def (sig (procedure " (string->cjson string)" (id string->cjson))) (p "Note that that's not " (tt "string->json") "! Parses the string and returns a " (tt "#<cjson>") " record which holds a c-struct representing the JSON. The returned record has a finalizer attached to it so the underlying c-struct gets freed on garbage collection."))
(def (sig (procedure " (string->cjson* string)" (id string->cjson*))) (p "Like " (tt "string->cjson") " but does not attach a finalizer to the " (tt "#<cjson>") " record. " (tt "cjson-free") " must be explicitly called later on the returned value to avoid memory leaks. This is sometimes faster than attaching finalizers, particularly if there are large numbers of " (tt "#<cjson>") " objects."))
(def (sig (procedure " (cjson->string cjson [pretty-print?])" (id cjson->string))) (p "Convert the " (tt "#<cjson>") " object to its JSON-representation, returned as a string. " (tt "pretty-print?") " defaults to true. Note that this can only serialize " (link "https://github.com/DaveGamble/cJSON" "cjson") " records, and not scheme objects."))
(def (sig (procedure " (cjson-schemify cjson)" (id cjson-schemify))) (p "Convert the " (tt "#<cjson>") " object to scheme data-structures. The data-structures are the same as " (link "http://wiki.call-cc.org/eggref/4/medea" "medea") "'s, where " (tt "array => vector") " and " (tt "object => alist") "."))
(def (sig (procedure " (string->json string)" (id string->json))) (p "Make scheme data-structures of the json data in " (tt "string") " using [cjson]:") (highlight scheme "    \n(define (string->json str)\n  (let* ((j (string->cjson* str))\n         (s (cjson-schemify j)))\n    (cjson-free j)\n    s))") (p "For string inputs, this should be API-equivalent of " (link "http://wiki.call-cc.org/eggref/4/medea" "medea") "'s " (tt "(read-json)") "."))
(def (sig (procedure " (cjson-type cjson)" (id cjson-type))) (p "Pick out the type of a " (link "https://github.com/DaveGamble/cJSON" "cjson") " record. Returns a fixnum.") (pre "   [variable] cjson/false\n   [variable] cjson/true\n   [variable] cjson/null\n   [variable] cjson/number\n   [variable] cjson/string\n   [variable] cjson/array\n   [variable] cjson/object") (p "Exposes the " (link "https://github.com/DaveGamble/cJSON" "cjson") "-type constants."))
(def (sig (procedure " (cjson-int cjson)" (id cjson-int)) (procedure " (cjson-double cjson)" (id cjson-double)) (procedure " (cjson-string cjson)" (id cjson-string)) (procedure " (cjson-key cjson)" (id cjson-key))) (p "\"Unbox\" the json value. " (tt "cjson-type") " must match like this:") (highlight scheme "    \n(select (cjson-type cjson)\n   ((cjson/false) #f)\n   ((cjson/true)  #t)\n   ((cjson/null) 'null)\n   ((cjson/number) (cjson-double cjson))\n   ((csjon/string) (cjson-string cjson))\n   (else (error \"probably a vector or object\")))\n\n[procedure] (cjson-array-size cjson)") (p "Return the number of elements in the array. If " (link "https://github.com/DaveGamble/cJSON" "cjson") "'s type is not an array, this is undefined bahaviour."))
(def (sig (procedure " (cjson-array-ref cjson index)" (id cjson-array-ref))) (p "Return the element of " (tt "cjson") " at position " (tt "index") ". " (tt "index") " must be a fixnum. Undefined behaviour if " (tt "cjson") " is not an array."))
(def (sig (procedure " (cjson-obj-ref cjson key)" (id cjson-obj-ref))) (p "Select field " (tt "key") " from " (tt "cjson") ". Key must be a string. Undefined behaviour if " (tt "cjson") " is not of type " (tt "cjosn/object") "."))
