The njson Reference Manual

This is the njson Reference Manual, version 1.2.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Tue Jul 15 06:05:35 2025 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 njson

NJSON is a JSON handling framework with the focus on convenience and brevity.

Author

Atlas Engineer LLC

Home Page

https://github.com/atlas-engineer/njson

Source Control

(GIT https://github.com/atlas-engineer/njson.git)

Bug Tracker

https://github.com/atlas-engineer/njson/issues

License

BSD-3 Clause

Version

1.2.2

Source

njson.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 njson/njson.asd

Source

njson.asd.

Parent Component

njson (system).

ASDF Systems

njson.


3.1.2 njson/package.lisp

Source

njson.asd.

Parent Component

njson (system).

Packages

njson.


3.1.3 njson/conditions.lisp

Dependency

package.lisp (file).

Source

njson.asd.

Parent Component

njson (system).

Public Interface
Internals

3.1.4 njson/njson.lisp

Dependency

conditions.lisp (file).

Source

njson.asd.

Parent Component

njson (system).

Public Interface

3.1.5 njson/functions.lisp

Dependency

njson.lisp (file).

Source

njson.asd.

Parent Component

njson (system).

Public Interface
Internals

3.1.6 njson/macros.lisp

Dependency

functions.lisp (file).

Source

njson.asd.

Parent Component

njson (system).

Public Interface
Internals

check-value (function).


3.1.7 njson/aliases.lisp

Dependency

macros.lisp (file).

Source

njson.asd.

Parent Component

njson (system).

Packages

njson/aliases.

Public Interface

4 Packages

Packages are listed by definition order.


4.1 njson/aliases

Short aliases for the regular njson functions.
Perfect with j: package-local-nickname, disastrous when :use-d.

Source

aliases.lisp.

Use List

common-lisp.

Public Interface

4.2 njson

NJSON is a convenience library for JSON handling. Important functions/APIs: - ‘njson:encode’ and ‘njson:decode’ as universal (en|de)coding functions working on strings, streams, and pathnames.
- ‘njson:jget’ (and ‘njson:get_’ alias) to get the value from decoded
and arbitrarily nested JSON array/object.
- ‘njson:jtruep’ (and aliases) to check the non-falsity of a decoded value.
- ‘njson:jif’, ‘njson:jwhen’, ‘njson:jor’, ‘njson:jand’, and
‘njson:jnot’ (and aliases) as convenience macros for JSON non-falsity-based control flow.

Generics to implement:
- ‘njson:encode-to-stream’ and ‘njson:decode-from-stream’ as the basic methods to specialize for every backend.
- ‘njson:encode-to-string’ and ‘njson:encode-to-file’, as more specific methods to speed things up.
- ‘njson:decode-from-string’ and ‘njson:decode-from-file’, as more
specific decoding methods.

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: and (&rest args)

JSON-aware version of ‘cl:and’.

Package

njson/aliases.

Alias for

jand.

Macro: bind (destructuring-pattern form &body body)

Match the FORM against DESTRUCTURING-PATTERN.
The pattern might be:
- A symbol, in which case the current chosen form is bound to it. If the symbol is _, simply skip the form.
- A literal form:
- String or number: compare with ‘equal’.
- Keywords :TRUE, :FALSE, and :NULL, matching T, NIL, and :NULL respectively.
- If the pattern is a property list of string+pattern pairs, match the string+pattern pairs inside it to the provided JSON object and resolve them recursively.
- If the pattern is a list of symbols (VAR &optional VAR-P), these are bound to the respective values of ‘jget’. It is a good way to make ‘jbind’ to be more lenient to missing keys, because the default behavior is to error on missing data.
- If the pattern is an inline vector, match it against a JSON array with at least as many elements as provided in the vector. Match every form in the vector against the element with the same index.

If the DESTRUCTURING-PATTERN doesn’t match the object, throw ‘value-mismatch’.

Underlying ‘jget’ can throw errors for the exceptionally malformed inputs. See ‘jget’ documentation for the types of errors it throws.

Example:
("hello" hello "a" _ "b" b
"array" #(first second third _))

matches a JSON object
{"hello": 3, "a": 8, "b": 3, "c": null, "array": [1, 2, 3, 4]}

and binds
- HELLO to 3
- B to 3
- FIRST to 1
- SECOND to 2
- THIRD to 3

It also checks that "a" key is present in the object and there’s a fourth element in the nested array.

See more examples in njson tests.

Package

njson/aliases.

Alias for

jbind.

Macro: if (test then &optional else)

JSON-aware version of ‘cl:if’.
If TEST is ‘jtruep’ evaluate THEN, otherwise evaluate ELSE.

Package

njson/aliases.

Alias for

jif.

Macro: jand (&rest args)

JSON-aware version of ‘cl:and’.

Package

njson.

Source

macros.lisp.

Macro: jbind (destructuring-pattern form &body body)

Match the FORM against DESTRUCTURING-PATTERN.
The pattern might be:
- A symbol, in which case the current chosen form is bound to it. If the symbol is _, simply skip the form.
- A literal form:
- String or number: compare with ‘equal’.
- Keywords :TRUE, :FALSE, and :NULL, matching T, NIL, and :NULL respectively.
- If the pattern is a property list of string+pattern pairs, match the string+pattern pairs inside it to the provided JSON object and resolve them recursively.
- If the pattern is a list of symbols (VAR &optional VAR-P), these are bound to the respective values of ‘jget’. It is a good way to make ‘jbind’ to be more lenient to missing keys, because the default behavior is to error on missing data.
- If the pattern is an inline vector, match it against a JSON array with at least as many elements as provided in the vector. Match every form in the vector against the element with the same index.

If the DESTRUCTURING-PATTERN doesn’t match the object, throw ‘value-mismatch’.

Underlying ‘jget’ can throw errors for the exceptionally malformed inputs. See ‘jget’ documentation for the types of errors it throws.

Example:
("hello" hello "a" _ "b" b
"array" #(first second third _))

matches a JSON object
{"hello": 3, "a": 8, "b": 3, "c": null, "array": [1, 2, 3, 4]}

and binds
- HELLO to 3
- B to 3
- FIRST to 1
- SECOND to 2
- THIRD to 3

It also checks that "a" key is present in the object and there’s a fourth element in the nested array.

See more examples in njson tests.

Package

njson.

Source

macros.lisp.

Macro: jif (test then &optional else)

JSON-aware version of ‘cl:if’.
If TEST is ‘jtruep’ evaluate THEN, otherwise evaluate ELSE.

Package

njson.

Source

macros.lisp.

Macro: jmatch (form &body clauses)

Similar to Trivia match macro, match the FORM (JSON value) against CLAUSES. CLAUSES are (PATTERN . BODY) forms, where
- PATTERN is a ‘jbind’ destructuring pattern.
- And BODY is an implicit progn.

If PATTERN matches successfully in ‘jbind’, then BODY is executed with the variables from the PATTERN bound to the respective values, as per ‘jbind’.

The last clause could start with T, OTHERWISE, ELSE, or _, and it will be invoked if other patterns don’t match. If there’s no such clause, ‘jmatch’ will simply return NIL on no matching patterns.

Package

njson.

Source

macros.lisp.

Macro: jor (&rest args)

JSON-aware version of ‘cl:or’.

Package

njson.

Source

macros.lisp.

Macro: jwhen (test &body body)

JSON-aware version of ‘cl:when’. If TEST is ‘jtruep’ evaluate BODY.

Package

njson.

Source

macros.lisp.

Macro: match (form &body clauses)

Similar to Trivia match macro, match the FORM (JSON value) against CLAUSES. CLAUSES are (PATTERN . BODY) forms, where
- PATTERN is a ‘jbind’ destructuring pattern.
- And BODY is an implicit progn.

If PATTERN matches successfully in ‘jbind’, then BODY is executed with the variables from the PATTERN bound to the respective values, as per ‘jbind’.

The last clause could start with T, OTHERWISE, ELSE, or _, and it will be invoked if other patterns don’t match. If there’s no such clause, ‘jmatch’ will simply return NIL on no matching patterns.

Package

njson/aliases.

Alias for

jmatch.

Macro: or (&rest args)

JSON-aware version of ‘cl:or’.

Package

njson/aliases.

Alias for

jor.

Macro: when (test &body body)

JSON-aware version of ‘cl:when’. If TEST is ‘jtruep’ evaluate BODY.

Package

njson/aliases.

Alias for

jwhen.


5.1.2 Ordinary functions

Function: @ (object &rest keys)

Alias for ‘jget’ that indexes OBJECT with KEYS. Setf-able.

Package

njson/aliases.

Source

aliases.lisp.

Function: (setf @) (object &rest keys)
Package

njson/aliases.

Source

aliases.lisp.

Function: jnot (arg)

JSON-aware version of ‘cl:not’.

Package

njson.

Source

functions.lisp.

Function: not (arg)

JSON-aware version of ‘cl:not’.

Package

njson/aliases.

Alias for

jnot.


5.1.3 Generic functions

Generic Function: copy (object)

Copy the OBJECT, potentially creating an identical one. Coerce all JSON arrays to adjustable vectors.

Package

njson/aliases.

Alias for

jcopy.

Generic Function: decode (from)

Decode OBJECT from JSON source FROM.
FROM can be a string, stream, pathname, or byte array.

Distinguishes between null/false and arrays/objects. Decodes:
- null as :NULL,
- false as nil,
- true as t,
- arrays as vectors,
- objects as hash-tables.

Package

njson/aliases.

Alias for

decode.

Generic Function: decode (from)

Decode OBJECT from JSON source FROM.
FROM can be a string, stream, pathname, or byte array.

Distinguishes between null/false and arrays/objects. Decodes:
- null as :NULL,
- false as nil,
- true as t,
- arrays as vectors,
- objects as hash-tables.

Package

njson.

Source

njson.lisp.

Methods
Method: decode ((from stream))
Method: decode ((from pathname))
Method: decode ((from string))
Generic Function: decode-from-file (file)

Decode JSON from FILE.
Specialize on ‘pathname’ to make NJSON better decode JSON files. Uses ‘decode-from-stream’ by default.

Package

njson.

Source

njson.lisp.

Methods
Method: decode-from-file (file)
Generic Function: decode-from-stream (stream)

Decode JSON from STREAM.
Specialize on ‘stream’ to make NJSON decode JSON.

Package

njson.

Source

njson.lisp.

Methods
Method: decode-from-stream (stream)
Generic Function: decode-from-string (string)

Decode JSON from STRING.
Specialize on ‘string’ to make NJSON better decode JSON strings. Uses ‘decode-from-stream’ by default.

Package

njson.

Source

njson.lisp.

Methods
Method: decode-from-string (string)
Generic Function: encode (object &optional to)

Encode OBJECT to JSON output spec TO.
TO can be:
- T, in which case ‘*standard-output*’ is used as encoding stream.
- NIL, in which case OBJECT is encoded to a string.
- STREAM, in which case OBJECT is encoded to it.
- PATHNAME, in which case OBJECT is encoded to the file designated by the pathname.

Distinguishes between null and false.
Encodes:
- :NULL as null,
- nil as false.

Package

njson/aliases.

Alias for

encode.

Generic Function: encode (object &optional to)

Encode OBJECT to JSON output spec TO.
TO can be:
- T, in which case ‘*standard-output*’ is used as encoding stream.
- NIL, in which case OBJECT is encoded to a string.
- STREAM, in which case OBJECT is encoded to it.
- PATHNAME, in which case OBJECT is encoded to the file designated by the pathname.

Distinguishes between null and false.
Encodes:
- :NULL as null,
- nil as false.

Package

njson.

Source

njson.lisp.

Methods
Method: encode :around (object &optional to)
Method: encode (object &optional to)
Generic Function: encode-to-file (object file)

Encode OBJECT to FILE.
Specialize on ‘pathname’ (and, optionally, OBJECT types) to make NJSON better encode JSON to files. Uses ‘encode-to-stream’ by default.

Package

njson.

Source

njson.lisp.

Methods
Method: encode-to-file (object file)
Generic Function: encode-to-stream (object stream)

Encode OBJECT to STREAM as JSON.
Specialize on ‘stream’ (and, optionally, OBJECT types) to make NJSON encode JSON.

Package

njson.

Source

njson.lisp.

Methods
Method: encode-to-stream (object stream)
Generic Function: encode-to-string (object)

Encode OBJECT to JSON string.
Specialize on ‘string’ (and, optionally, OBJECT types) to make NJSON better encode JSON to strings. Uses ‘encode-to-stream’ by default.

Package

njson.

Source

njson.lisp.

Methods
Method: encode-to-string (object)
Generic Function: ensure-array (object &key convert-objects &allow-other-keys)

Ensure that the return value is an array.
If OBJECT is an array already, return it.
If it’s a literal value, wrap it into a one-element array.
If it’s an object:
- When CONVERT-OBJECTS is T, put all the values into an array (order not guaranteed).
- Otherwise wrap the object into an array.

Package

njson/aliases.

Alias for

ensure-array.

Generic Function: ensure-array (object &key convert-objects &allow-other-keys)

Ensure that the return value is an array.
If OBJECT is an array already, return it.
If it’s a literal value, wrap it into a one-element array.
If it’s an object:
- When CONVERT-OBJECTS is T, put all the values into an array (order not guaranteed).
- Otherwise wrap the object into an array.

Package

njson.

Source

functions.lisp.

Methods
Method: ensure-array ((object hash-table) &key convert-objects &allow-other-keys)
Method: ensure-array ((object sequence) &key &allow-other-keys)
Method: ensure-array ((object string) &key &allow-other-keys)
Method: ensure-array ((object null) &key &allow-other-keys)
Method: ensure-array (object &key &allow-other-keys)
Generic Function: ensure-object (key object &key &allow-other-keys)

Ensure that the return value is a JSON object.
If OBJECT is an object already, return it, checking KEY presence. If it’s anything else, wrap it into an object with OBJECT under KEY.

Throws errors from underlying ‘jget’.

Package

njson/aliases.

Alias for

ensure-object.

Generic Function: ensure-object (key object &key &allow-other-keys)

Ensure that the return value is a JSON object.
If OBJECT is an object already, return it, checking KEY presence. If it’s anything else, wrap it into an object with OBJECT under KEY.

Throws errors from underlying ‘jget’.

Package

njson.

Source

functions.lisp.

Methods
Method: ensure-object ((key string) (object hash-table) &key &allow-other-keys)
Method: ensure-object ((key string) object &key &allow-other-keys)
Generic Function: get (key-or-index object)

Get the value at KEY-OR-INDEX in OBJECT.

KEY-OR-INDEX can be
- an integer (for array indexing),
- a string (for object keying),
- a pathname (with JSON Pointer syntax),
- a sequence of integers and strings (to index the nested structures).
- an empty sequence/pathname (to match the whole object).

Return two values: the value under KEY-OR-INDEX and whether this value
was found.

- (Starting from version 2) Throw ‘no-key’ when the key is not present in the object. - Throw ‘invalid-key’ if using the wrong index type.
- Throw ‘non-indexable’ when trying to index something other than
JSON arrays or objects.
- Throw ‘invalid-pointer’ when using JSON Pointer with invalid syntax
as key.

For example, to get the data from a structure like
{"data": [1, 2, {"three": 3}]}
you can use
(jget #("data" 2 "three") data)
;; => 3, T

OBJECT can be JSON array or object, which in Lisp translates to
‘array’ or ‘hash-table’.

‘jget*’ is a more structured and strict version of ‘jget’, enforcing
the ‘no-key’ condition and removing the two-valued approach because of
that. ‘jget*’ will be merged into ‘jget’ in version 2.

Package

njson/aliases.

Alias for

jget.

Generic Function: (setf get) (key-or-index object)

Set the value at KEY-OR-INDEX in OBJECT.

The arguments are the same as in ‘jget’, except KEY-OR-INDEX cannot be an empty pathname/sequence (because setting the object itself to a new value is not possible in CL, unless it’s a place, which is not guaranteed for ‘jget’ arguments).

- Throw ‘invalid-key’ if using the wrong index type.
- Throw ‘non-indexable’ when trying to index something other than JSON arrays or objects.
- Throw ‘invalid-pointer’ when using JSON Pointer with invalid syntax as key.

OBJECT can be JSON array or object, which in Lisp translates to ‘array’ or ‘hash-table’.

Package

njson/aliases.

Alias for

(setf jget).

Generic Function: get* (key-or-index object)

A version of ‘jget’ that’s more strict regarding missing keys.

Package

njson/aliases.

Alias for

jget*.

Generic Function: jcopy (object)

Copy the OBJECT, potentially creating an identical one. Coerce all JSON arrays to adjustable vectors.

Package

njson.

Source

functions.lisp.

Methods
Method: jcopy ((object real))
Method: jcopy ((object (eql :null)))
Method: jcopy ((object (eql t)))
Method: jcopy ((object null))
Method: jcopy ((object string))
Method: jcopy ((object array))
Method: jcopy ((object hash-table))
Generic Function: jget (key-or-index object)

Get the value at KEY-OR-INDEX in OBJECT.

KEY-OR-INDEX can be
- an integer (for array indexing),
- a string (for object keying),
- a pathname (with JSON Pointer syntax),
- a sequence of integers and strings (to index the nested structures).
- an empty sequence/pathname (to match the whole object).

Return two values: the value under KEY-OR-INDEX and whether this value
was found.

- (Starting from version 2) Throw ‘no-key’ when the key is not present in the object. - Throw ‘invalid-key’ if using the wrong index type.
- Throw ‘non-indexable’ when trying to index something other than
JSON arrays or objects.
- Throw ‘invalid-pointer’ when using JSON Pointer with invalid syntax
as key.

For example, to get the data from a structure like
{"data": [1, 2, {"three": 3}]}
you can use
(jget #("data" 2 "three") data)
;; => 3, T

OBJECT can be JSON array or object, which in Lisp translates to
‘array’ or ‘hash-table’.

‘jget*’ is a more structured and strict version of ‘jget’, enforcing
the ‘no-key’ condition and removing the two-valued approach because of
that. ‘jget*’ will be merged into ‘jget’ in version 2.

Package

njson.

Source

functions.lisp.

Methods
Method: jget (key-or-index object)
Generic Function: (setf jget) (key-or-index object)

Set the value at KEY-OR-INDEX in OBJECT.

The arguments are the same as in ‘jget’, except KEY-OR-INDEX cannot be an empty pathname/sequence (because setting the object itself to a new value is not possible in CL, unless it’s a place, which is not guaranteed for ‘jget’ arguments).

- Throw ‘invalid-key’ if using the wrong index type.
- Throw ‘non-indexable’ when trying to index something other than JSON arrays or objects.
- Throw ‘invalid-pointer’ when using JSON Pointer with invalid syntax as key.

OBJECT can be JSON array or object, which in Lisp translates to ‘array’ or ‘hash-table’.

Package

njson.

Source

functions.lisp.

Methods
Method: (setf jget) ((keys sequence) object)
Method: (setf jget) ((index integer) (object array))
Method: (setf jget) ((key string) (object hash-table))
Method: (setf jget) ((pointer pathname) object)
Method: (setf jget) ((index string) (object array))
Method: (setf jget) ((key integer) (object hash-table))
Method: (setf jget) (key object)
Method: (setf jget) :around (key (object string))
Generic Function: jget* (key-or-index object)

A version of ‘jget’ that’s more strict regarding missing keys.

Package

njson.

Source

functions.lisp.

Methods
Method: jget* ((keys sequence) object)
Method: jget* ((index integer) (object array))
Method: jget* ((key string) (object hash-table))
Method: jget* ((pointer pathname) object)
Method: jget* ((index string) (object array))
Method: jget* ((key integer) (object hash-table))
Method: jget* (key object)
Method: jget* ((key string) (object string))
Method: jget* ((key integer) (object string))
Generic Function: jkeys (object)

Get keys to index OBJECT with, as a list of integers/strings. If the OBJECT is not a JSON array/object, throws ‘non-indexable’.

Package

njson.

Source

functions.lisp.

Methods
Method: jkeys ((object vector))
Method: jkeys ((object string))
Method: jkeys ((object hash-table))
Method: jkeys (object)
Generic Function: jtrue-p (object)

Test OBJECT for truthiness in JSON terms.

Recognize all the values true, except for null and false. This is to make the transition from JSON to Lisp (2 false values -> 1 false value) smoother.

Unlike JavaScript, empty strings and zero are not false (because this behavior is confusing).

Package

njson.

Alias for

jtruep.

Generic Function: jtrue? (object)

Test OBJECT for truthiness in JSON terms.

Recognize all the values true, except for null and false. This is to make the transition from JSON to Lisp (2 false values -> 1 false value) smoother.

Unlike JavaScript, empty strings and zero are not false (because this behavior is confusing).

Package

njson.

Alias for

jtruep.

Generic Function: jtruep (object)

Test OBJECT for truthiness in JSON terms.

Recognize all the values true, except for null and false. This is to make the transition from JSON to Lisp (2 false values -> 1 false value) smoother.

Unlike JavaScript, empty strings and zero are not false (because this behavior is confusing).

Package

njson.

Source

functions.lisp.

Methods
Method: jtruep (object)
Method: jtruep ((object symbol))
Generic Function: keys (object)

Get keys to index OBJECT with, as a list of integers/strings. If the OBJECT is not a JSON array/object, throws ‘non-indexable’.

Package

njson/aliases.

Alias for

jkeys.

Generic Function: true (object)

Test OBJECT for truthiness in JSON terms.

Recognize all the values true, except for null and false. This is to make the transition from JSON to Lisp (2 false values -> 1 false value) smoother.

Unlike JavaScript, empty strings and zero are not false (because this behavior is confusing).

Package

njson/aliases.

Alias for

jtruep.

Generic Function: true? (object)

Test OBJECT for truthiness in JSON terms.

Recognize all the values true, except for null and false. This is to make the transition from JSON to Lisp (2 false values -> 1 false value) smoother.

Unlike JavaScript, empty strings and zero are not false (because this behavior is confusing).

Package

njson/aliases.

Alias for

jtruep.

Generic Function: truep (object)

Test OBJECT for truthiness in JSON terms.

Recognize all the values true, except for null and false. This is to make the transition from JSON to Lisp (2 false values -> 1 false value) smoother.

Unlike JavaScript, empty strings and zero are not false (because this behavior is confusing).

Package

njson/aliases.

Alias for

jtruep.


5.1.4 Conditions

Condition: decode-from-stream-not-implemented

Incomplete decoding implementation error.

Package

njson.

Source

conditions.lisp.

Direct superclasses

jerror.

Condition: encode-to-stream-not-implemented

Incomplete encoding implementation error.

Package

njson.

Source

conditions.lisp.

Direct superclasses

jerror.

Condition: invalid-key

The condition thrown on using wrong key with object/array.

Package

njson.

Source

conditions.lisp.

Direct superclasses

jerror.

Direct methods
Direct slots
Slot: object
Initargs

:object

Readers

object.

Writers

(setf object).

Slot: key
Initargs

:key

Readers

key.

Writers

(setf key).

Condition: invalid-pointer

Condition thrown when trying to index an object with invalid pointer.

Package

njson.

Source

conditions.lisp.

Direct superclasses

jerror.

Direct methods
Direct slots
Slot: pointer
Initargs

:pointer

Readers

pointer.

Writers

(setf pointer).

Condition: jerror

Fundamental error class all the NJSON errors inherit from.

Package

njson.

Source

conditions.lisp.

Direct superclasses

error.

Direct subclasses
Condition: no-key

Condition thrown when trying to index an object/array with a key not present in it.

Package

njson.

Source

conditions.lisp.

Direct superclasses

jerror.

Direct methods
Direct slots
Slot: object
Initargs

:object

Readers

object.

Writers

(setf object).

Slot: key
Initargs

:key

Readers

key.

Writers

(setf key).

Condition: non-indexable

The condition thrown on trying to index non-object/array.

Package

njson.

Source

conditions.lisp.

Direct superclasses

jerror.

Direct methods
Direct slots
Slot: value
Initargs

:value

Readers

value.

Writers

(setf value).

Condition: value-mismatch

Condition thrown when getting a value not matching ‘jbind’/‘jmatch’ specification.

Package

njson.

Source

conditions.lisp.

Direct superclasses

jerror.

Direct methods
Direct slots
Slot: expected
Initargs

:expected

Readers

expected.

Writers

(setf expected).

Slot: actual
Initargs

:actual

Readers

actual.

Writers

(setf actual).

Slot: object
Initargs

:object

Readers

object.

Writers

(setf object).


5.2 Internals


5.2.1 Ordinary functions

Function: check-value (expected indices object)

Check that JSON value in OBJECT at INDICES is ‘equal’ to EXPECTED specification.

Package

njson.

Source

macros.lisp.

Function: json-short-print (object)

Produce a string with a short object representation for debugging.

May actually produce long results for objects/arrays with many members. But it’s implied that these are rare cases and don’t need special treatment.

Package

njson.

Source

conditions.lisp.

Function: make-singular-array (object)
Package

njson.

Source

functions.lisp.

Function: parse-pointer-pathname (pointer-pathname)

Parse POINTER-PATHNAME per JSON Pointer rules (https://www.rfc-editor.org/rfc/rfc6901). Only supports JSON string representation, not the URL one.

Package

njson.

Source

functions.lisp.

Function: read-new-key ()
Package

njson.

Source

conditions.lisp.

Function: read-new-pointer ()
Package

njson.

Source

conditions.lisp.

Function: read-new-value ()
Package

njson.

Source

conditions.lisp.

Function: type-num (object)
Package

njson.

Source

conditions.lisp.


5.2.2 Generic functions

Generic Reader: actual (condition)
Generic Writer: (setf actual) (condition)
Package

njson.

Methods
Reader Method: actual ((condition value-mismatch))
Writer Method: (setf actual) ((condition value-mismatch))
Source

conditions.lisp.

Target Slot

actual.

Generic Reader: deprecated (condition)
Generic Writer: (setf deprecated) (condition)
Package

njson.

Methods
Reader Method: deprecated ((condition deprecated))
Writer Method: (setf deprecated) ((condition deprecated))
Source

conditions.lisp.

Target Slot

deprecated.

Generic Reader: expected (condition)
Generic Writer: (setf expected) (condition)
Package

njson.

Methods
Reader Method: expected ((condition value-mismatch))
Writer Method: (setf expected) ((condition value-mismatch))
Source

conditions.lisp.

Target Slot

expected.

Generic Reader: key (condition)
Generic Writer: (setf key) (condition)
Package

njson.

Methods
Reader Method: key ((condition no-key))
Writer Method: (setf key) ((condition no-key))
Source

conditions.lisp.

Target Slot

key.

Reader Method: key ((condition invalid-key))
Writer Method: (setf key) ((condition invalid-key))
Source

conditions.lisp.

Target Slot

key.

Generic Reader: object (condition)
Generic Writer: (setf object) (condition)
Package

njson.

Methods
Reader Method: object ((condition value-mismatch))
Writer Method: (setf object) ((condition value-mismatch))
Source

conditions.lisp.

Target Slot

object.

Reader Method: object ((condition no-key))
Writer Method: (setf object) ((condition no-key))
Source

conditions.lisp.

Target Slot

object.

Reader Method: object ((condition invalid-key))
Writer Method: (setf object) ((condition invalid-key))
Source

conditions.lisp.

Target Slot

object.

Generic Reader: pointer (condition)
Generic Writer: (setf pointer) (condition)
Package

njson.

Methods
Reader Method: pointer ((condition invalid-pointer))
Writer Method: (setf pointer) ((condition invalid-pointer))
Source

conditions.lisp.

Target Slot

pointer.

Generic Reader: replacement (condition)
Generic Writer: (setf replacement) (condition)
Package

njson.

Methods
Reader Method: replacement ((condition deprecated))
Writer Method: (setf replacement) ((condition deprecated))
Source

conditions.lisp.

Target Slot

replacement.

Generic Reader: value (condition)
Generic Writer: (setf value) (condition)
Package

njson.

Methods
Reader Method: value ((condition non-indexable))
Writer Method: (setf value) ((condition non-indexable))
Source

conditions.lisp.

Target Slot

value.


5.2.3 Conditions

Condition: deprecated

Deprecation warning.

Package

njson.

Source

conditions.lisp.

Direct superclasses

warning.

Direct methods
Direct slots
Slot: deprecated
Initargs

:deprecated

Readers

deprecated.

Writers

(setf deprecated).

Slot: replacement
Initargs

:replacement

Readers

replacement.

Writers

(setf replacement).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (   @  
A   B   C   D   E   F   G   I   J   K   M   N   O   P   R   T   V   W  
Index Entry  Section

(
(setf @): Public ordinary functions
(setf actual): Private generic functions
(setf actual): Private generic functions
(setf deprecated): Private generic functions
(setf deprecated): Private generic functions
(setf expected): Private generic functions
(setf expected): Private generic functions
(setf get): Public generic functions
(setf jget): Public generic functions
(setf jget): Public generic functions
(setf jget): Public generic functions
(setf jget): Public generic functions
(setf jget): Public generic functions
(setf jget): Public generic functions
(setf jget): Public generic functions
(setf jget): Public generic functions
(setf jget): Public generic functions
(setf key): Private generic functions
(setf key): Private generic functions
(setf key): Private generic functions
(setf object): Private generic functions
(setf object): Private generic functions
(setf object): Private generic functions
(setf object): Private generic functions
(setf pointer): Private generic functions
(setf pointer): Private generic functions
(setf replacement): Private generic functions
(setf replacement): Private generic functions
(setf value): Private generic functions
(setf value): Private generic functions

@
@: Public ordinary functions

A
actual: Private generic functions
actual: Private generic functions
and: Public macros

B
bind: Public macros

C
check-value: Private ordinary functions
copy: Public generic functions

D
decode: Public generic functions
decode: Public generic functions
decode: Public generic functions
decode: Public generic functions
decode: Public generic functions
decode-from-file: Public generic functions
decode-from-file: Public generic functions
decode-from-stream: Public generic functions
decode-from-stream: Public generic functions
decode-from-string: Public generic functions
decode-from-string: Public generic functions
deprecated: Private generic functions
deprecated: Private generic functions

E
encode: Public generic functions
encode: Public generic functions
encode: Public generic functions
encode: Public generic functions
encode-to-file: Public generic functions
encode-to-file: Public generic functions
encode-to-stream: Public generic functions
encode-to-stream: Public generic functions
encode-to-string: Public generic functions
encode-to-string: Public generic functions
ensure-array: Public generic functions
ensure-array: Public generic functions
ensure-array: Public generic functions
ensure-array: Public generic functions
ensure-array: Public generic functions
ensure-array: Public generic functions
ensure-array: Public generic functions
ensure-object: Public generic functions
ensure-object: Public generic functions
ensure-object: Public generic functions
ensure-object: Public generic functions
expected: Private generic functions
expected: Private generic functions

F
Function, (setf @): Public ordinary functions
Function, @: Public ordinary functions
Function, check-value: Private ordinary functions
Function, jnot: Public ordinary functions
Function, json-short-print: Private ordinary functions
Function, make-singular-array: Private ordinary functions
Function, not: Public ordinary functions
Function, parse-pointer-pathname: Private ordinary functions
Function, read-new-key: Private ordinary functions
Function, read-new-pointer: Private ordinary functions
Function, read-new-value: Private ordinary functions
Function, type-num: Private ordinary functions

G
Generic Function, (setf actual): Private generic functions
Generic Function, (setf deprecated): Private generic functions
Generic Function, (setf expected): Private generic functions
Generic Function, (setf get): Public generic functions
Generic Function, (setf jget): Public generic functions
Generic Function, (setf key): Private generic functions
Generic Function, (setf object): Private generic functions
Generic Function, (setf pointer): Private generic functions
Generic Function, (setf replacement): Private generic functions
Generic Function, (setf value): Private generic functions
Generic Function, actual: Private generic functions
Generic Function, copy: Public generic functions
Generic Function, decode: Public generic functions
Generic Function, decode: Public generic functions
Generic Function, decode-from-file: Public generic functions
Generic Function, decode-from-stream: Public generic functions
Generic Function, decode-from-string: Public generic functions
Generic Function, deprecated: Private generic functions
Generic Function, encode: Public generic functions
Generic Function, encode: Public generic functions
Generic Function, encode-to-file: Public generic functions
Generic Function, encode-to-stream: Public generic functions
Generic Function, encode-to-string: Public generic functions
Generic Function, ensure-array: Public generic functions
Generic Function, ensure-array: Public generic functions
Generic Function, ensure-object: Public generic functions
Generic Function, ensure-object: Public generic functions
Generic Function, expected: Private generic functions
Generic Function, get: Public generic functions
Generic Function, get*: Public generic functions
Generic Function, jcopy: Public generic functions
Generic Function, jget: Public generic functions
Generic Function, jget*: Public generic functions
Generic Function, jkeys: Public generic functions
Generic Function, jtrue-p: Public generic functions
Generic Function, jtrue?: Public generic functions
Generic Function, jtruep: Public generic functions
Generic Function, key: Private generic functions
Generic Function, keys: Public generic functions
Generic Function, object: Private generic functions
Generic Function, pointer: Private generic functions
Generic Function, replacement: Private generic functions
Generic Function, true: Public generic functions
Generic Function, true?: Public generic functions
Generic Function, truep: Public generic functions
Generic Function, value: Private generic functions
get: Public generic functions
get*: Public generic functions

I
if: Public macros

J
jand: Public macros
jbind: Public macros
jcopy: Public generic functions
jcopy: Public generic functions
jcopy: Public generic functions
jcopy: Public generic functions
jcopy: Public generic functions
jcopy: Public generic functions
jcopy: Public generic functions
jcopy: Public generic functions
jget: Public generic functions
jget: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jget*: Public generic functions
jif: Public macros
jkeys: Public generic functions
jkeys: Public generic functions
jkeys: Public generic functions
jkeys: Public generic functions
jkeys: Public generic functions
jmatch: Public macros
jnot: Public ordinary functions
jor: Public macros
json-short-print: Private ordinary functions
jtrue-p: Public generic functions
jtrue?: Public generic functions
jtruep: Public generic functions
jtruep: Public generic functions
jtruep: Public generic functions
jwhen: Public macros

K
key: Private generic functions
key: Private generic functions
key: Private generic functions
keys: Public generic functions

M
Macro, and: Public macros
Macro, bind: Public macros
Macro, if: Public macros
Macro, jand: Public macros
Macro, jbind: Public macros
Macro, jif: Public macros
Macro, jmatch: Public macros
Macro, jor: Public macros
Macro, jwhen: Public macros
Macro, match: Public macros
Macro, or: Public macros
Macro, when: Public macros
make-singular-array: Private ordinary functions
match: Public macros
Method, (setf actual): Private generic functions
Method, (setf deprecated): Private generic functions
Method, (setf expected): Private generic functions
Method, (setf jget): Public generic functions
Method, (setf jget): Public generic functions
Method, (setf jget): Public generic functions
Method, (setf jget): Public generic functions
Method, (setf jget): Public generic functions
Method, (setf jget): Public generic functions
Method, (setf jget): Public generic functions
Method, (setf jget): Public generic functions
Method, (setf key): Private generic functions
Method, (setf key): Private generic functions
Method, (setf object): Private generic functions
Method, (setf object): Private generic functions
Method, (setf object): Private generic functions
Method, (setf pointer): Private generic functions
Method, (setf replacement): Private generic functions
Method, (setf value): Private generic functions
Method, actual: Private generic functions
Method, decode: Public generic functions
Method, decode: Public generic functions
Method, decode: Public generic functions
Method, decode-from-file: Public generic functions
Method, decode-from-stream: Public generic functions
Method, decode-from-string: Public generic functions
Method, deprecated: Private generic functions
Method, encode: Public generic functions
Method, encode: Public generic functions
Method, encode-to-file: Public generic functions
Method, encode-to-stream: Public generic functions
Method, encode-to-string: Public generic functions
Method, ensure-array: Public generic functions
Method, ensure-array: Public generic functions
Method, ensure-array: Public generic functions
Method, ensure-array: Public generic functions
Method, ensure-array: Public generic functions
Method, ensure-object: Public generic functions
Method, ensure-object: Public generic functions
Method, expected: Private generic functions
Method, jcopy: Public generic functions
Method, jcopy: Public generic functions
Method, jcopy: Public generic functions
Method, jcopy: Public generic functions
Method, jcopy: Public generic functions
Method, jcopy: Public generic functions
Method, jcopy: Public generic functions
Method, jget: Public generic functions
Method, jget*: Public generic functions
Method, jget*: Public generic functions
Method, jget*: Public generic functions
Method, jget*: Public generic functions
Method, jget*: Public generic functions
Method, jget*: Public generic functions
Method, jget*: Public generic functions
Method, jget*: Public generic functions
Method, jget*: Public generic functions
Method, jkeys: Public generic functions
Method, jkeys: Public generic functions
Method, jkeys: Public generic functions
Method, jkeys: Public generic functions
Method, jtruep: Public generic functions
Method, jtruep: Public generic functions
Method, key: Private generic functions
Method, key: Private generic functions
Method, object: Private generic functions
Method, object: Private generic functions
Method, object: Private generic functions
Method, pointer: Private generic functions
Method, replacement: Private generic functions
Method, value: Private generic functions

N
not: Public ordinary functions

O
object: Private generic functions
object: Private generic functions
object: Private generic functions
object: Private generic functions
or: Public macros

P
parse-pointer-pathname: Private ordinary functions
pointer: Private generic functions
pointer: Private generic functions

R
read-new-key: Private ordinary functions
read-new-pointer: Private ordinary functions
read-new-value: Private ordinary functions
replacement: Private generic functions
replacement: Private generic functions

T
true: Public generic functions
true?: Public generic functions
truep: Public generic functions
type-num: Private ordinary functions

V
value: Private generic functions
value: Private generic functions

W
when: Public macros


A.4 Data types

Jump to:   A   C   D   E   F   I   J   M   N   P   S   V  
Index Entry  Section

A
aliases.lisp: The njson/aliases․lisp file

C
Condition, decode-from-stream-not-implemented: Public conditions
Condition, deprecated: Private conditions
Condition, encode-to-stream-not-implemented: Public conditions
Condition, invalid-key: Public conditions
Condition, invalid-pointer: Public conditions
Condition, jerror: Public conditions
Condition, no-key: Public conditions
Condition, non-indexable: Public conditions
Condition, value-mismatch: Public conditions
conditions.lisp: The njson/conditions․lisp file

D
decode-from-stream-not-implemented: Public conditions
deprecated: Private conditions

E
encode-to-stream-not-implemented: Public conditions

F
File, aliases.lisp: The njson/aliases․lisp file
File, conditions.lisp: The njson/conditions․lisp file
File, functions.lisp: The njson/functions․lisp file
File, macros.lisp: The njson/macros․lisp file
File, njson.asd: The njson/njson․asd file
File, njson.lisp: The njson/njson․lisp file
File, package.lisp: The njson/package․lisp file
functions.lisp: The njson/functions․lisp file

I
invalid-key: Public conditions
invalid-pointer: Public conditions

J
jerror: Public conditions

M
macros.lisp: The njson/macros․lisp file

N
njson: The njson system
njson: The njson package
njson.asd: The njson/njson․asd file
njson.lisp: The njson/njson․lisp file
njson/aliases: The njson/aliases package
no-key: Public conditions
non-indexable: Public conditions

P
Package, njson: The njson package
Package, njson/aliases: The njson/aliases package
package.lisp: The njson/package․lisp file

S
System, njson: The njson system

V
value-mismatch: Public conditions