Common Lisp Package: COM.GIGAMONKEYS.JSON

README:

FUNCTION

Public

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.

PARSE-JSON (TEXT)

Parse json text into Lisp objects. Hash tables are used to represent Javascript objects and vectors to represent arrays.

WRITE-JSON (DATA &OPTIONAL (STREAM *STANDARD-OUTPUT*))

Write DATA to STREAM in JSON format.

Private

Undocumented

EMIT-JSON-CHAR (CHAR STREAM)

GENERIC-FUNCTION

Public

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.

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.

Private

EMIT-JSON (OBJECT STREAM)

Emit object to stream as JSON.

VARIABLE

Public

Undocumented

*OBJECT-TYPE*