Common Lisp Package: ST-JSON

README:

FUNCTION

Public

AS-JSON-BOOL (VALUE)

Convert a generalised boolean to a :true/:false keyword.

FROM-JSON-BOOL (VALUE)

Convert :true or :false to its boolean equivalent.

GETJSO (KEY MAP)

Fetch a value from a JS object. Returns a second value like gethash.

SETFGETJSO (VAL KEY MAP)

Store a value in a JS object.

JSO (&REST FIELDS)

Create a JS object. Arguments should be alternating labels and values.

MAPJSO (FUNC MAP)

Iterate over the key/value pairs in a JS object.

READ-JSON-AS-TYPE (SOURCE TYPE)

Read a JSON value and assert the result to be of a given type. Raises a json-type-error when the type is wrong.

WRITE-JSON (ELEMENT STREAM)

Write a value's JSON representation to a stream.

WRITE-JSON-TO-STRING (ELEMENT)

Write a value's JSON representation to a string.

Undocumented

READ-JSON-FROM-STRING (STRING &KEY (START 0) END JUNK-ALLOWED-P)

Private

JSO-ALIST (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

AT-EOF (STREAM)

COPY-JSO (INSTANCE)

ENDS-ATOM (CHAR)

GATHER-COMMA-SEPARATED (STREAM END-CHAR OBJ-NAME GATHER-FUNC)

IS-WHITESPACE (CHAR)

SETFJSO-ALIST (NEW-VALUE INSTANCE)

JSO-P (OBJECT)

LOOKS-LIKE-A-NUMBER (STRING)

MAKE-JSO (&KEY ((ALIST DUM5) NIL))

RAISE (TYPE FORMAT &REST ARGS)

READ-JSON-ATOM (STREAM)

READ-JSON-ELEMENT (STREAM)

READ-JSON-LIST (STREAM)

READ-JSON-OBJECT (STREAM)

READ-JSON-STRING (STREAM)

SKIP-WHITESPACE (STREAM)

MACRO

Public

Undocumented

GETJSO* (KEYS JSO)

GENERIC-FUNCTION

Public

READ-JSON (IN &OPTIONAL JUNK-ALLOWED-P)

Read a JSON-encoded value from a stream or a string.

WRITE-JSON-ELEMENT (ELEMENT STREAM)

Method used for writing values of a specific type. You can specialise this for your own types.

VARIABLE

Public

*SCRIPT-TAG-HACK*

Bind this to T when writing JSON that will be written to an HTML document. It prevents '</script>' from occurring in strings by escaping any slash following a '<' character.

Private

Undocumented

*OPTIMIZE*

*READING-SLOT-NAME*

CLASS

Public

Undocumented

JSO (&REST FIELDS)

CONDITION

Public

Undocumented

JSON-EOF-ERROR

JSON-ERROR

JSON-PARSE-ERROR

JSON-TYPE-ERROR

Private

Undocumented

JSON-WRITE-ERROR