API Reference


Library for reading and writing JSON-formatted data.


  • Variable *OBJECT-TYPE*
  • Function PARSE-JSON (text)
    Parse json text into Lisp objects. Hash tables are used to represent Javascript objects and vectors to represent arrays.


  • Function WRITE-JSON (data &optional (stream *standard-output*))
    Write DATA to STREAM in JSON format.
  • Function JSON (data)
    The top-level function for converting Lisp objects into a string in the JSON format. It can convert any object that can be converted to a json-exp via the to-json generic function.
  • Generic-Function TO-JSON (thing)
    Generic function that can convert an arbitrary Lisp object to a json-exp, i.e. a sexp that can then be rendered as json. To make an arbitrary class convertable to JSON, add a method to this generic function that generates a json-exp.
  • Generic-Function JSON-STRINGIFY (object)
    Convert object directly to a JSON representation as a string. Default methods are provided for strings, symbols (which must be keywords), and numbers but there may be situations where it is appropriate to define new methods on this function. In general, however, it is probably better to define a method on to-json to convert the object to a sexp that can be rendered as JSON.
  • Method JSON-STRINGIFY ((object t))
  • Method JSON-STRINGIFY ((object symbol))
  • Method JSON-STRINGIFY ((object number))
  • Method TO-JSON ((thing hash-table))

Also exports