Common Lisp Package: JSON

README:

FUNCTION

Public

CAMEL-CASE-TO-LISP (STRING)

Take a camel-case string and convert it into a string with Lisp-style hyphenation.

CLEAR-CLASS-REGISTRY

Reset the *CLASS-REGISTRY* to NIL.

DECODE-JSON (&OPTIONAL (STREAM *JSON-INPUT*))

Read a JSON Value from STREAM and return the corresponding Lisp value.

DECODE-JSON-FROM-SOURCE (SOURCE &OPTIONAL (DECODER 'DECODE-JSON))

Decode a JSON Value from SOURCE using the value of DECODER (default 'DECODE-JSON) as decoder function. If the SOURCE is a string, the input is from this string; if it is a pathname, the input is from the file that it names; otherwise, a stream is expected as SOURCE.

DECODE-JSON-FROM-STRING (JSON-STRING)

Read a JSON Value from JSON-STRING and return the corresponding Lisp value.

DECODE-JSON-STRICT (&OPTIONAL (STREAM *JSON-INPUT*))

Same as DECODE-JSON, but allow only Objects or Arrays on the top level, no junk afterwards.

ENCODE-ARRAY-MEMBER (OBJECT &OPTIONAL (STREAM *JSON-OUTPUT*))

Encode OBJECT as the next Member of the innermost JSON Array opened with WITH-ARRAY in the dynamic context. OBJECT is encoded using the ENCODE-JSON generic function, so it must be of a type for which an ENCODE-JSON method is defined.

ENCODE-JSON-ALIST (ALIST &OPTIONAL (STREAM *JSON-OUTPUT*))

Write the JSON representation (Object) of ALIST to STREAM (or to *JSON-OUTPUT*). Return NIL.

ENCODE-JSON-ALIST-TO-STRING (ALIST)

Return the JSON representation (Object) of ALIST as a string.

ENCODE-JSON-PLIST (PLIST &OPTIONAL (STREAM *JSON-OUTPUT*))

Write the JSON representation (Object) of PLIST to STREAM (or to *JSON-OUTPUT*). Return NIL.

ENCODE-JSON-PLIST-TO-STRING (PLIST)

Return the JSON representation (Object) of PLIST as a string.

ENCODE-JSON-TO-STRING (OBJECT)

Return the JSON representation of OBJECT as a string.

ENCODE-OBJECT-MEMBER (KEY VALUE &OPTIONAL (STREAM *JSON-OUTPUT*))

Encode KEY and VALUE as a Member pair of the innermost JSON Object opened with WITH-OBJECT in the dynamic context. KEY and VALUE are encoded using the ENCODE-JSON generic function, so they both must be of a type for which an ENCODE-JSON method is defined. If KEY does not encode to a String, its JSON representation (as a string) is encoded over again.

JSON-BOOL (VALUE)

Intended for the JSON-EXPLICT-ENCODER. Converts a non-nil value to a value (:true) that creates a json true value when used in the explict encoder. Or (:false).

JSON-INTERN (STRING)

Intern STRING in the current *JSON-SYMBOLS-PACKAGE*.

JSON-OR-NULL (VALUE)

Intended for the JSON-EXPLICT-ENCODER. Returns a non-nil value as itself, or a nil value as a json null-value

JSON-SYNTAX-ERROR (STREAM FORMAT-CONTROL &REST FORMAT-ARGUMENTS)

Signal a JSON-SYNTAX-ERROR condition.

LISP-TO-CAMEL-CASE (STRING)

Take a string with Lisp-style hyphentation and convert it to camel case. This is an inverse of CAMEL-CASE-TO-LISP.

SAFE-JSON-INTERN (STRING)

The default json-intern is not safe. Interns of many unique symbols could potentially use a lot of memory. An attack could exploit this by submitting something that is passed through cl-json that has many very large, unique symbols. This version is safe in that respect because it only allows symbols that already exists.

SET-DECODER-SIMPLE-CLOS-SEMANTICS

Set the decoder semantics to the following: * Strings and Numbers are decoded naturally, reals becoming floats. * The literal name true is decoded to T, false and null to NIL. * Arrays are decoded to sequences of the type *JSON-ARRAY-TYPE*. * Objects are decoded to CLOS objects. Object keys are converted by the function *JSON-IDENTIFIER-NAME-TO-LISP*. If a JSON Object has a field whose key matches *PROTOTYPE-NAME*, the class of the CLOS object and the package wherein to intern slot names are inferred from the corresponding value which must be a valid prototype. Otherwise, a FLUID-OBJECT is constructed whose slot names are interned in *JSON-SYMBOLS-PACKAGE*.

SET-DECODER-SIMPLE-LIST-SEMANTICS

Set the decoder semantics to the following: * Strings and Numbers are decoded naturally, reals becoming floats. * The literal name true is decoded to T, false and null to NIL. * Arrays are decoded to sequences of the type *JSON-ARRAY-TYPE*. * Objects are decoded to alists. Object keys are converted by the function *JSON-IDENTIFIER-NAME-TO-LISP* and then interned in the package *JSON-SYMBOLS-PACKAGE*.

SIMPLIFIED-CAMEL-CASE-TO-LISP (CAMEL-STRING)

Insert - between lowercase and uppercase chars. Ignore _ + * and several consecutive uppercase.

STREAM-ARRAY-MEMBER-ENCODER (STREAM &OPTIONAL (ENCODER #'ENCODE-JSON))

Return a function which takes an argument and encodes it to STREAM as a Member of an Array. The encoding function is taken from the value of ENCODER (default is #'ENCODE-JSON).

STREAM-OBJECT-MEMBER-ENCODER (STREAM &OPTIONAL (ENCODER #'ENCODE-JSON))

Return a function which takes two arguments and encodes them to STREAM as a Member of an Object (String : Value pair).

UNENCODABLE-VALUE-ERROR (VALUE &OPTIONAL CONTEXT)

Signal an UNENCODABLE-VALUE-ERROR.

Undocumented

UNKNOWN-SYMBOL-ERROR (STRING)

USE-EXPLICIT-ENCODER

USE-GUESSING-ENCODER

Private

ACCUMULATOR-ADD (ELEMENT)

Add ELEMENT to the end of the list accumulator.

ACCUMULATOR-ADD-KEY (KEY)

Add a cons whose CAR is KEY to the end of the list accumulator.

ACCUMULATOR-ADD-KEY-OR-SET-PROTOTYPE (KEY)

If KEY (in a JSON Object being decoded) matches *PROTOTYPE-NAME*, prepare to decode the corresponding Value as a PROTOTYPE object. Otherwise, do the same as ACCUMULATOR-ADD-KEY.

ACCUMULATOR-ADD-VALUE (VALUE)

Set the CDR of the most recently accumulated cons to VALUE.

ACCUMULATOR-ADD-VALUE-OR-SET-PROTOTYPE (VALUE)

If VALUE (in a JSON Object being decoded) corresponds to a key which matches *PROTOTYPE-NAME*, set VALUE to be the prototype of the Object. Otherwise, do the same as ACCUMULATOR-ADD-VALUE.

ACCUMULATOR-GET

Return all values accumulated so far in the list accumulator as a list.

ACCUMULATOR-GET-OBJECT

Return a CLOS object, using keys and values accumulated so far in the list accumulator as slot names and values, respectively. If the JSON Object had a prototype field infer the class of the object and the package wherein to intern slot names from the prototype. Otherwise, create a FLUID-OBJECT with slots interned in *JSON-SYMBOLS-PACKAGE*.

ACCUMULATOR-GET-SEQUENCE

Return all values accumulated so far in the list accumulator as *JSON-ARRAY-TYPE*.

ACCUMULATOR-GET-STRING

Return all values accumulated so far in the list accumulator as *JSON-ARRAY-TYPE*.

CAMEL-CASE-SPLIT (STRING)

Assume STRING is in camel case, and split it into largest possible ``homogenous'' parts. A homogenous part consists either a) of upper-case alphabetic chars; or b) of lower-case alphabetic chars with an optional initial upper-case; or c) of decimal digits; or d) of a single non-alphanumeric char. The return value is a list of pairs (CATEGORY . PART) where CATEGORY is one of the keywords :UPPER, :UPPER-1, :LOWER, :NUMERIC, :MIXED, and PART is a substring of STRING.

CAMEL-CASE-TRANSFORM (PARTS &OPTIONAL (CAT-BEFORE PUNCT))

Take a list of PARTS (as returned by CAMEL-CASE-SPLIT) and transform it into a string with Lisp-style hyphenation, assuming that some initial portion of it does not contain :UPPER parts.

CAMEL-CASE-TRANSFORM-ALL-CAPS (PARTS &OPTIONAL CAT-BEFORE FROM-NUMERIC)

Take a list of PARTS (as returned by CAMEL-CASE-SPLIT) and transform it into a string with Lisp-style hyphenation, assuming that some initial portion of it does not contain :MIXED parts.

DECODE-JSON-ARRAY (STREAM)

Read comma-separated sequence of JSON Values until a closing bracket, calling array handlers as it goes.

DECODE-JSON-OBJECT (STREAM)

Read comma-separated sequence of JSON String:Value pairs until a closing brace, calling object handlers as it goes.

DECODE-JSON-STRING (STREAM)

Read JSON String characters / escape sequences until a closing double quote, calling string handlers as it goes.

ENCODE-JSON-LIST-GUESSING-ENCODER (S STREAM)

Write the JSON representation of the list S to STREAM (or to *JSON-OUTPUT*). If S is not encodable as a JSON Array, try to encode it as an Object (per ENCODE-JSON-ALIST).

ENSURE-FLUID-CLASS-WITH-SLOTS (SLOTS SUPERCLASSES &OPTIONAL EXTANT-CLASS)

Create or update a fluid class, ensuring that it has (at least) all the given SLOTS and SUPERCLASSES.

FIND-CLASS* (CLASS-DESIGNATOR)

Like FIND-CLASS, but allow self-designating classes for the argument, and assert that the resulting class is a STANDARD-CLASS.

INIT-ACCUMULATOR

Initialize a list accumulator.

INIT-ACCUMULATOR-AND-PROTOTYPE

Initialize a list accumulator and a prototype.

INIT-STRING-STREAM-ACCUMULATOR

Initialize a string-stream accumulator.

JSON-BOOLEAN-TO-LISP (TOKEN)

Take a literal name token and convert it to a boolean value.

MAKE-AND-POPULATE-INSTANCE (CLASS BINDINGS)

Make an instance of the given CLASS, and set its slots to given values. BINDINGS must be a list of pairs whose CARs are slot names and CDRs are the respective values. If no slot of a given name is defined in the CLASS, the corresponding value is discarded.

MAP-SLOTS (FUNCTION OBJECT)

Call FUNCTION on the name and value of every bound slot in OBJECT.

MAX-PACKAGE (SYMBOLS &KEY ((INITIAL-VALUE PACKAGE) (FIND-PACKAGE 'COMMON-LISP)))

Try to find a package P such that the names of the given SYMBOLS, when interned in P, yield the same symbols. If no such package exists, return an unspecific value and issue a warning.

MAYBE-ADD-PROTOTYPE (OBJECT PROTOTYPE)

If the PROTOTYPE is not NIL, and the OBJECT has a slot to accept it, do set it. Return OBJECT.

NEXT-AGGREGATE-MEMBER (CONTEXT STREAM)

Between two members of an Object or Array, print a comma separator.

PACKAGE-NAME* (PACKAGE)

Same as PACKAGE-NAME, but ensure that the result is a symbol.

PARSE-NUMBER (TOKEN)

Take a number token and convert it to a numeric value.

PEEK-JSON-TOKEN (STREAM)

Return 2 values: the category and the first character of the next token available in the given STREAM. Unlike READ-JSON-TOKEN, this function can not discriminate between integers and reals (hence, it returns a single :NUMBER category), and cannot check whether the next available symbol is a valid boolean or not (hence, the category for such tokens is :SYMBOL).

READ-JSON-NAME-TOKEN (STREAM)

Read a JSON literal name token from the given STREAM, and return 2 values: the token category (:BOOLEAN) and the token itself, as a string.

READ-JSON-NUMBER-TOKEN (STREAM)

Read a JSON number token from the given STREAM, and return 2 values: the token category (:INTEGER or :REAL) and the token itself, as a string.

READ-JSON-STRING-CHAR (STREAM)

Read a JSON String char (or escape sequence) from the STREAM and return it. If an end of string (unescaped quote) is encountered, return NIL.

READ-JSON-TOKEN (STREAM)

Read a JSON token (literal name, number or punctuation char) from the given STREAM, and return 2 values: the token category (a symbol) and the token itself, as a string or character.

STRING-STREAM-ACCUMULATOR-ADD (CHAR)

Add CHAR to the end of the string-stream accumulator.

STRING-STREAM-ACCUMULATOR-GET

Return all characters accumulated so far in a string-stream accumulator and close the stream.

WRITE-JSON-CHARS (S STREAM)

Write JSON representations (chars or escape sequences) of characters in string S to STREAM.

WRITE-JSON-NUMBER (NR STREAM)

Write the JSON representation of the number NR to STREAM.

WRITE-JSON-STRING (S STREAM)

Write a JSON representation (String) of S to STREAM.

Undocumented

CUSTOM-KEY-TO-VARIABLE (KEY)

ENCODE-JSON-LIST-EXPLICIT-ENCODER (S STREAM)

JSON-BIND-LEVEL-CUSTOMIZATIONS (LEVEL-KEYS VALUE-REQUIRED DECODER VALIDATOR KEY-HANDLER VALUE-HANDLER PASS)

RANGE-KEYS (VAR-KEYS)

MACRO

Public

AS-ARRAY-MEMBER ((&OPTIONAL (STREAM '*JSON-OUTPUT*)) &BODY BODY)

BODY should be a program which encodes exactly one JSON datum to STREAM. AS-ARRAY-MEMBER ensures that the datum is properly formatted as a Member of an Array, i. e. separated by comma from any preceding or following Member.

AS-OBJECT-MEMBER ((KEY &OPTIONAL (STREAM '*JSON-OUTPUT*)) &BODY BODY)

BODY should be a program which writes exactly one JSON datum to STREAM. AS-OBJECT-MEMBER ensures that the datum is properly formatted as a Member of an Object, i. e. preceded by the (encoded) KEY and colon, and separated by comma from any preceding or following Member.

CURRENT-DECODER (&REST KEYS)

Capture current values of custom variables and return a custom decoder which restores these values in its dynamic environment.

CUSTOM-DECODER (&REST CUSTOMIZATIONS)

Return a function which is like DECODE-JSON called in a dynamic environment with the given CUSTOMIZATIONS.

WITH-ARRAY ((&OPTIONAL (STREAM '*JSON-OUTPUT*)) &BODY BODY)

Open a JSON Array, run BODY, then close the Array. Inside the BODY, AS-ARRAY-MEMBER or ENCODE-ARRAY-MEMBER should be called to encode Members of the Array.

WITH-CUSTOM-DECODER-LEVEL ((&REST CUSTOMIZATIONS) &BODY BODY)

Execute BODY in a dynamic environment such that, when nested structures are decoded, the outermost level is decoded with the given custom handlers (CUSTOMIZATIONS) whereas inner levels are decoded in the usual way.

WITH-DECODER-SIMPLE-CLOS-SEMANTICS (&BODY BODY)

Execute BODY in a dynamic environement where the decoder semantics is such as set by SET-DECODER-SIMPLE-CLOS-SEMANTICS.

WITH-DECODER-SIMPLE-LIST-SEMANTICS (&BODY BODY)

Execute BODY in a dynamic environement where the decoder semantics is such as set by SET-DECODER-SIMPLE-LIST-SEMANTICS.

WITH-LOCAL-CLASS-REGISTRY ((&KEY INHERIT) &BODY BODY)

Run BODY in a dynamic environment where *CLASS-REGISTRY* is a temporary local list. If :INHERIT is non-null, the local registry shall initially have the same content as the exterior *CLASS-REGISTRY*, otherwise it shall be NIL.

WITH-OBJECT ((&OPTIONAL (STREAM '*JSON-OUTPUT*)) &BODY BODY)

Open a JSON Object, run BODY, then close the Object. Inside the BODY, AS-OBJECT-MEMBER or ENCODE-OBJECT-MEMBER should be called to encode Members of the Object.

WITH-SUBSTITUTE-PRINTED-REPRESENTATION-RESTART ((OBJECT STREAM) &BODY BODY)

Establish a SUBSTITUTE-PRINTED-REPRESENTATION restart for OBJECT and execute BODY.

Undocumented

BIND-CUSTOM-VARS ((&REST CUSTOMIZATIONS) &BODY BODY)

JSON-BIND ((&REST VARS) JSON-SOURCE &BODY BODY)

SET-CUSTOM-VARS (&REST CUSTOMIZATIONS)

WITH-EXPLICIT-ENCODER (&BODY BODY)

WITH-GUESSING-ENCODER (&BODY BODY)

WITH-SHADOWED-CUSTOM-VARS (&BODY BODY)

Private

AGGREGATE-SCOPE-PROGV (VARIABLES &BODY BODY)

Establish a dynamic environment where all VARIABLES are freshly bound (to their current values), and execute BODY in it, returning the result.

ESCAPED-CHAR-DISPATCH (CHAR &KEY CODE-HANDLER DEFAULT-HANDLER)

Compiles the escaped character alist to a (CASE ...) match expression.

WITH-AGGREGATE ((CONTEXT BEGIN-CHAR END-CHAR &OPTIONAL (STREAM '*JSON-OUTPUT*)) &BODY BODY)

Run BODY to encode a JSON aggregate type, delimited by BEGIN-CHAR and END-CHAR.

Undocumented

DEFINE-CUSTOM-VAR ((KEY NAME) &REST OTHER-ARGS)

LET-GENSYMS ((&REST NAMES) &BODY BODY)

LOOP-ON-CUSTOM ((KEY VAR &OPTIONAL VALUE) &REST CLAUSES)

WITH-LOCAL-ENCODER (&BODY BODY)

GENERIC-FUNCTION

Public

ENCODE-JSON (OBJECT &OPTIONAL STREAM)

Write a JSON representation of OBJECT to STREAM and return NIL.

MAKE-OBJECT (BINDINGS CLASS &OPTIONAL SUPERCLASSES)

If CLASS is not NIL, create an instance of that class. Otherwise, create a fluid object whose class has the given SUPERCLASSES (null list by default). In either case, populate the resulting object using BINDINGS (an alist of slot names and values).

MAKE-OBJECT-PROTOTYPE (OBJECT &OPTIONAL SLOT-NAMES)

Return a PROTOTYPE describing the OBJECT's class or superclasses, and the package into which the names of the class / superclasses and of the OBJECT's slots are to be interned.

Private

Undocumented

ADD-DIRECT-SUBCLASS (CLASS SUBCLASS)

SETFCLASS-DIRECT-SLOTS (NEW-VALUE SLOT-CLASS)

SETFCLASS-SLOTS (NEW-VALUE SLOT-CLASS)

COMPUTE-CLASS-PRECEDENCE-LIST (ROOT)

FINALIZE-INHERITANCE (CLASS)

OFFENDING-CODE (CONDITION)

REMOVE-DIRECT-SUBCLASS (CLASS SUBCLASS)

STREAM-ERROR-STREAM-FILE-POSITION (CONDITION)

UNENCODABLE-VALUE-ERROR-CONTEXT (CONDITION)

SETFUNENCODABLE-VALUE-ERROR-CONTEXT (NEW-VALUE CONDITION)

UNKNOWN-SYMBOL-ERROR-DATUM (CONDITION)

SETFUNKNOWN-SYMBOL-ERROR-DATUM (NEW-VALUE CONDITION)

VALIDATE-SUPERCLASS (CLASS SUPERCLASS)

SLOT-ACCESSOR

Private

Undocumented

CLASS-DIRECT-SLOTS (CLASS)

CLASS-DIRECT-SUPERCLASSES (CLASS)

CLASS-PRECEDENCE-LIST (PCL-CLASS)

CLASS-SLOTS (CLASS)

LISP-CLASS (OBJECT)

LISP-PACKAGE (OBJECT)

LISP-SUPERCLASSES (OBJECT)

SLOT-DEFINITION-NAME (SLOT-DEFINITION)

SETFSLOT-DEFINITION-NAME (NEW-VALUE SLOT-DEFINITION)

VARIABLE

Public

*AGGREGATE-SCOPE-VARIABLES*

A list of symbols naming dynamic variables which should be re-bound in the scope of every JSON aggregate value (Object, Array or String).

*ARRAY-MEMBER-HANDLER*

Designator for a function of 1 arbitrary argument (decoded member of Array).

*ARRAY-SCOPE-VARIABLES*

A list of symbols naming dynamic variables which should be re-bound in the scope of every JSON Array.

*BEGINNING-OF-ARRAY-HANDLER*

Designator for a function of no arguments (called at encountering an opening bracket for an Array).

*BEGINNING-OF-OBJECT-HANDLER*

Designator for a function of no arguments (called at encountering an opening brace for an Object).

*BEGINNING-OF-STRING-HANDLER*

Designator for a function of no arguments (called at encountering an opening quote for a String).

*BOOLEAN-HANDLER*

Designator for a function of 1 string argument (boolean token).

*END-OF-ARRAY-HANDLER*

Designator for a function of no arguments (called at encountering a closing bracket for an Array).

*END-OF-OBJECT-HANDLER*

Designator for a function of no arguments (called at encountering a closing brace for an Object).

*END-OF-STRING-HANDLER*

Designator for a function of no arguments (called at encountering a closing quote for a String).

*IDENTIFIER-NAME-TO-KEY*

Designator for a function which, during decoding, maps the *json-identifier-name-to-lisp* -transformed key to the value it will have in the result object.

*INTEGER-HANDLER*

Designator for a function of 1 string argument (integer token).

*INTERNAL-DECODER*

Designator for a function of 1 stream argument called (instead of DECODE-JSON) to decode a member of an Array or of an Object.

*JSON-ARRAY-TYPE*

The Lisp sequence type to which JSON Arrays are to be coerced.

*JSON-IDENTIFIER-NAME-TO-LISP*

Designator for a function which maps string (a JSON Object key) to string (name of a Lisp symbol).

*JSON-INPUT*

The default input stream for decoding operations.

*JSON-OUTPUT*

The default output stream for encoding operations.

*JSON-SYMBOLS-PACKAGE*

The package where JSON Object keys etc. are interned. Default KEYWORD, NIL = use current *PACKAGE*.

*LISP-IDENTIFIER-NAME-TO-JSON*

Designator for a function which maps string (name of a Lisp symbol) to string (e. g. JSON Object key).

*OBJECT-KEY-HANDLER*

Designator for a function of 1 string argument (decoded member key of Object).

*OBJECT-SCOPE-VARIABLES*

A list of symbols naming dynamic variables which should be re-bound in the scope of every JSON Object.

*OBJECT-VALUE-HANDLER*

Designator for a function of 1 arbitrary argument (decoded member value of Object).

*PROTOTYPE-NAME*

The key of the prototype field in a JSON Object, and the name of a slot in a Lisp object which accepts its prototype.

*REAL-HANDLER*

Designator for a function of 1 string argument (real token).

*STRING-CHAR-HANDLER*

Designator for a function of 1 character argument (String char).

*STRING-SCOPE-VARIABLES*

A list of symbols naming dynamic variables which should be re-bound in the scope of every JSON String.

*USE-STRICT-JSON-RULES*

If non-nil, signal error on unrecognized escape sequences in JSON Strings. If nil, translate any such sequence to the char after slash.

Private

*ACCUMULATOR*

List or vector where elements are stored.

*ACCUMULATOR-LAST*

If *ACCUMULATOR* is a list, this refers to its last cons.

*CLASS-REGISTRY*

A list of anonymous fluid classes, one member for every distinct combination of direct superclasses.

*JSON-AGGREGATE-CONTEXT*

NIL outside of any aggregate environment, 'ARRAY or 'OBJECT within the respective environments.

*JSON-AGGREGATE-FIRST*

T when the first member of a JSON Object or Array is encoded, afterwards NIL.

*PROTOTYPE*

When NIL, the Object being decoded does not (yet?) have a prototype. When T, the decoder should get ready to decode a prototype field. Otherwise, the value should be a prototype for the object being decoded.

*PROTOTYPE-PROTOTYPE*

The prototype for a prototype object.

+JSON-LISP-ESCAPED-CHARS+

Mapping between JSON String escape sequences and Lisp chars.

+JSON-LISP-SYMBOL-TOKENS+

Mapping between JSON literal names and Lisp boolean values.

Undocumented

*CUSTOM-VARS*

*JSON-LIST-ENCODER-FN*

CLASS

Public

FLUID-CLASS

A class to whose instances arbitrary new slots may be added on the fly.

FLUID-OBJECT

Any instance of a fluid class.

PROTOTYPE

A PROTOTYPE contains metadata for an object's class in a format easily serializable to JSON: either the name of the class as a string or (if it is anonymous) the names of the superclasses as a list of strings; and the name of the Lisp package into which the names of the class's slots and the name of the class / superclasses are to be interned.

CONDITION

Public

JSON-SYNTAX-ERROR (STREAM FORMAT-CONTROL &REST FORMAT-ARGUMENTS)

Signalled when non-well-formed JSON data are encountered.

NO-CHAR-FOR-CODE

Signalled when, in a JSON String, an escaped code point (uXXXX) is encountered which is greater than the application's CHAR-CODE-LIMIT or for which CODE-CHAR returns NIL.

UNENCODABLE-VALUE-ERROR (VALUE &OPTIONAL CONTEXT)

Signalled when a datum is passed to ENCODE-JSON (or another encoder function) which actually cannot be encoded.

UNKNOWN-SYMBOL-ERROR (STRING)

Signalled by safe-json-intern when a symbol that is not already interned in *json-symbols-package* is found.