This is the com.inuoe.jzon Reference Manual, version 1.1.4, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:32:47 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
com.inuoe.jzon
A correct and safe(r) JSON RFC 8259 reader/writer with sane defaults.
Wilfredo Velázquez-Rodríguez <zulu.inuoe@gmail.com>
MIT
1.1.4
closer-mop
(system).
flexi-streams
(system).
float-features
(system)., for feature (:not :ecl)
trivial-gray-streams
(system).
uiop
(system).
eisel-lemire.lisp
(file).
ratio-to-double.lisp
(file).
schubfach.lisp
(file).
jzon.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
com.inuoe.jzon/com.inuoe.jzon.asd
com.inuoe.jzon/eisel-lemire.lisp
com.inuoe.jzon/ratio-to-double.lisp
com.inuoe.jzon/schubfach.lisp
com.inuoe.jzon/jzon.lisp
com.inuoe.jzon/com.inuoe.jzon.asd
com.inuoe.jzon
(system).
com.inuoe.jzon/eisel-lemire.lisp
com.inuoe.jzon
(system).
make-double
(function).
%<<u64
(macro).
%>>u64
(macro).
%bits-double-float
(macro).
%gen-powers-of-ten-tables
(function).
%mul64
(function).
%uint64
(macro).
*%detailed-powers-of-ten-max*
(special variable).
*%detailed-powers-of-ten-min*
(special variable).
+%pow10-max+
(constant).
+%pow10-min+
(constant).
com.inuoe.jzon/ratio-to-double.lisp
com.inuoe.jzon
(system).
ratio-to-double
(function).
%bits-double-float
(macro).
%make-float-from-fixnums
(function).
com.inuoe.jzon/schubfach.lisp
com.inuoe.jzon
(system).
write-double
(function).
write-float
(function).
%<<
(macro).
%<<32
(macro).
%<<64
(macro).
%>>
(macro).
%>>32
(macro).
%>>64
(macro).
%>>>
(macro).
%>>>32
(macro).
%>>>64
(macro).
%digit-count
(function).
%double-float-bits
(macro).
%int
(macro).
%int32
(macro).
%int64
(macro).
%multiply-high
(macro).
%rop2
(function).
%rop3
(function).
%single-float-bits
(macro).
%write-2-digits
(function).
%write-3-digits
(function).
%write-double
(function).
%write-float
(function).
%write-fraction-digits
(function).
%write-positive-int-digits
(function).
%write-significant-fraction-digits32
(function).
%write-significant-fraction-digits64
(function).
*%digits*
(special variable).
*%gs*
(special variable).
*%offsets*
(special variable).
stringify-double
(function).
stringify-float
(function).
com.inuoe.jzon/jzon.lisp
eisel-lemire.lisp
(file).
ratio-to-double.lisp
(file).
schubfach.lisp
(file).
com.inuoe.jzon
(system).
*writer*
(special variable).
begin-array
(function).
begin-array*
(function).
begin-object
(function).
begin-object*
(function).
close-parser
(function).
close-writer
(function).
coerce-key
(generic function).
coerced-fields
(generic function).
end-array
(function).
end-array*
(function).
end-object
(function).
end-object*
(function).
json-atom
(type).
json-element
(type).
json-eof-error
(condition).
json-error
(condition).
json-limit-error
(condition).
json-parse-error
(condition).
json-parse-limit-error
(condition).
json-recursive-write-error
(condition).
json-write-error
(condition).
json-write-limit-error
(condition).
make-parser
(function).
make-writer
(function).
parse
(function).
parse-next
(function).
parse-next-element
(function).
parser
(class).
span
(function).
stream-write-char
(method).
stream-write-string
(method).
stringify
(function).
with-array
(macro).
with-array*
(macro).
with-object
(macro).
with-object*
(macro).
with-parser
(macro).
with-writer
(macro).
with-writer*
(macro).
write-array
(function).
write-array*
(function).
write-key
(function).
write-key*
(function).
write-object
(function).
write-object*
(function).
write-properties
(function).
write-properties*
(function).
write-property*
(function).
write-value
(generic function).
write-value*
(function).
write-values
(function).
write-values*
(function).
writer
(class).
%calc-pos
(function).
%control-char-p
(function).
%ends-token-p
(function).
%ensure-function
(function).
%json-limit-error-limit
(reader method).
%json-parse-error-column
(reader method).
%json-parse-error-line
(reader method).
%json-recursive-write-error-path
(reader method).
%key-fn
(function).
%make-fns
(function).
%make-fns-array-ub8
(function).
%make-fns-binary-stream
(function).
%make-fns-simple-array-ub8
(function).
%make-fns-simple-string
(function).
%make-fns-stream
(function).
%make-fns-string
(function).
%make-parser-state
(function).
%make-string-pool
(function).
%octet-vector-span
(class).
%parse
(function).
%parse-next
(function).
%parser-state
(structure).
%parser-state-context
(reader).
(setf %parser-state-context)
(writer).
%parser-state-lookahead
(reader).
(setf %parser-state-lookahead)
(writer).
%parser-state-state
(reader).
(setf %parser-state-state)
(writer).
%raise
(function).
%raise-limit
(function).
%read-json-number
(function).
%read-json-string
(function).
%read-string
(function).
%read-unicode
(function).
%skip-cpp-comment
(function).
%skip-whitespace
(function).
%span
(class).
%step
(function).
%string-output-stream
(class).
%string-span
(class).
%type=
(function).
%utf-8-decode
(function).
%whitespace-p
(function).
%write-indentation
(function).
%write-json-atom
(function).
%write-json-string
(function).
write-property
(function).
Packages are listed by definition order.
com.inuoe.jzon/ratio-to-double
common-lisp
.
ratio-to-double
(function).
%bits-double-float
(macro).
%make-float-from-fixnums
(function).
com.inuoe.jzon/eisel-lemire
common-lisp
.
make-double
(function).
%<<u64
(macro).
%>>u64
(macro).
%bits-double-float
(macro).
%gen-powers-of-ten-tables
(function).
%mul64
(function).
%uint64
(macro).
*%detailed-powers-of-ten-max*
(special variable).
*%detailed-powers-of-ten-min*
(special variable).
+%pow10-max+
(constant).
+%pow10-min+
(constant).
com.inuoe.jzon
common-lisp
.
*writer*
(special variable).
begin-array
(function).
begin-array*
(function).
begin-object
(function).
begin-object*
(function).
close-parser
(function).
close-writer
(function).
coerce-key
(generic function).
coerced-fields
(generic function).
end-array
(function).
end-array*
(function).
end-object
(function).
end-object*
(function).
json-atom
(type).
json-element
(type).
json-eof-error
(condition).
json-error
(condition).
json-limit-error
(condition).
json-parse-error
(condition).
json-parse-limit-error
(condition).
json-recursive-write-error
(condition).
json-write-error
(condition).
json-write-limit-error
(condition).
make-parser
(function).
make-writer
(function).
parse
(function).
parse-next
(function).
parse-next-element
(function).
parser
(class).
span
(function).
stringify
(function).
with-array
(macro).
with-array*
(macro).
with-object
(macro).
with-object*
(macro).
with-parser
(macro).
with-writer
(macro).
with-writer*
(macro).
write-array
(function).
write-array*
(function).
write-key
(function).
write-key*
(function).
write-object
(function).
write-object*
(function).
write-properties
(function).
write-properties*
(function).
write-property*
(function).
write-value
(generic function).
write-value*
(function).
write-values
(function).
write-values*
(function).
writer
(class).
%calc-pos
(function).
%control-char-p
(function).
%ends-token-p
(function).
%ensure-function
(function).
%json-limit-error-limit
(generic reader).
%json-parse-error-column
(generic reader).
%json-parse-error-line
(generic reader).
%json-recursive-write-error-path
(generic reader).
%key-fn
(function).
%make-fns
(function).
%make-fns-array-ub8
(function).
%make-fns-binary-stream
(function).
%make-fns-simple-array-ub8
(function).
%make-fns-simple-string
(function).
%make-fns-stream
(function).
%make-fns-string
(function).
%make-parser-state
(function).
%make-string-pool
(function).
%octet-vector-span
(class).
%parse
(function).
%parse-next
(function).
%parser-state
(structure).
%parser-state-context
(reader).
(setf %parser-state-context)
(writer).
%parser-state-lookahead
(reader).
(setf %parser-state-lookahead)
(writer).
%parser-state-state
(reader).
(setf %parser-state-state)
(writer).
%raise
(function).
%raise-limit
(function).
%read-json-number
(function).
%read-json-string
(function).
%read-string
(function).
%read-unicode
(function).
%skip-cpp-comment
(function).
%skip-whitespace
(function).
%span
(class).
%step
(function).
%string-output-stream
(class).
%string-span
(class).
%type=
(function).
%utf-8-decode
(function).
%whitespace-p
(function).
%write-indentation
(function).
%write-json-atom
(function).
%write-json-string
(function).
write-property
(function).
com.inuoe.jzon/schubfach
common-lisp
.
write-double
(function).
write-float
(function).
%<<
(macro).
%<<32
(macro).
%<<64
(macro).
%>>
(macro).
%>>32
(macro).
%>>64
(macro).
%>>>
(macro).
%>>>32
(macro).
%>>>64
(macro).
%digit-count
(function).
%double-float-bits
(macro).
%int
(macro).
%int32
(macro).
%int64
(macro).
%multiply-high
(macro).
%rop2
(function).
%rop3
(function).
%single-float-bits
(macro).
%write-2-digits
(function).
%write-3-digits
(function).
%write-double
(function).
%write-float
(function).
%write-fraction-digits
(function).
%write-positive-int-digits
(function).
%write-significant-fraction-digits32
(function).
%write-significant-fraction-digits64
(function).
*%digits*
(special variable).
*%gs*
(special variable).
*%offsets*
(special variable).
stringify-double
(function).
stringify-float
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The active ‘writer’ for the various ‘write-*’ functions.
Wrapper around ‘begin-array’ and ‘end-array’
see ‘write-array’
see ‘write-values’
As ‘with-array’, but using the currently bound ‘*writer*’.
Wrapper around ‘begin-object’ and ‘end-object’.
see ‘write-object’
see ‘write-property’
see ‘write-properties’
As ‘with-object’, but using the currently bound ‘*writer*’.
Create a ‘parser’, ensuring ‘close-parser’ is called on it on exit.
see ‘make-parser’
see ‘close-parser’
Create a ‘writer’, ensuring ‘close-writer’ is called on it on exit.
see ‘make-writer’
see ‘close-writer’
Create a new ‘writer’ using ‘args’ and bind it to ‘*writer*’
‘args’ are a the same as ‘make-writer’
Begin writing an array to ‘writer’.
see ‘write-values’
see ‘end-array’
As ‘begin-array’, but using the currently bound ‘*writer*’.
Begin writing an object to ‘writer’.
see ‘write-key’
see ‘write-property’
see ‘write-properties’
see ‘end-object’
As ‘begin-object’, but using the currently bound ‘*writer*’.
Close the ‘parser’
Close the ‘writer’.
Finish writing an array to ‘writer’. Must match an opening ‘begin-array’.
As ‘end-array’, but using the currently bound ‘*writer*’.
Finish writing an object to ‘writer’. Must match an opening ‘begin-object’.
As ‘end-object’, but using the currently bound ‘*writer*’.
Construct a ‘parser’ Read a JSON value from ‘in’, which may be a vector, a stream, or a pathname.
‘:allow-comments’ controls if we allow single-line // comments and /**/ multiline block comments.
‘:allow-trailing-comma’ controls if we allow a single comma ‘,’ after all elements of an array or object.
‘:allow-multiple-content’ controls if we alow extra content beyond a single toplevel JSON value.
‘:max-string-length’ controls the maximum length allowed when reading a string key or value.
‘:key-fn’ is a function of one value which ’pools’ object keys, or ‘nil’ to disable pooling, and ‘t’ for the default pool.
see ‘next’
see ‘close-parser’
Create a writer for subsequent ‘write-value’, ‘begin-object’, et al calls.
‘:stream’ like the ‘destination’ in ‘format’, or a ‘pathname’
‘:pretty’ if true, pretty-format the output
‘:replacer’ a function which takes a key and value as an argument, and returns t or nil, indicating whether the KV pair should be written.
- Optionally returns a second value, indicating the value to be stringified in place of the given value.
‘:coerce-key’ is a function of one argument, and is used to coerce object keys into non-nil string designators
‘:max-depth’ is an integer denoting the maximum depth to allow nesting during writing, or nil
see ‘coerce-key’
Read a JSON value from ‘in’, which may be a vector, a stream, a pathname, or a span from ‘span’.
‘:max-depth’ controls the maximum depth allowed when nesting arrays or objects.
‘:allow-comments’ controls if we allow single-line // comments and /**/ multiline block comments.
‘:allow-trailing-comma’ controls if we allow a single comma ‘,’ after all elements of an array or object.
‘:allow-multiple-content’ controls if we alow extra content beyond a single toplevel JSON value.
‘:max-string-length’ controls the maximum length allowed when reading a string key or value.
‘:key-fn’ is a function of one value which ’pools’ object keys, or ‘nil’ to disable pooling, and ‘t’ for the default pool.
Read the next token from ‘parser’.
Returns 2 values:
:value, value ; A ‘json-atom’ <value>
:begin-array, nil ; Array open [
:end-array, nil ; Array close ]
:begin-object, nil ; Object open {
:object-key, key ; Object key
:end-object, nil ; Object finished }
nil. nil ; Parsing complete
see ‘with-parser’
see ‘make-parser’
see ‘close-parser’
Read the next available ‘json-element’ from ‘parser’.
This is a utility function around ‘parse-next’ for advancing the ‘parser’ to a certain point, and reading
an element at that point.
‘parse-next-element’ must be called when the ‘parser’ is in a position that allows values:
1. toplevel
2. inside reading array
3. after reading object key
4. after toplevel when ‘allow-multiple-content’ is true on the ‘parser’
In the case that we are in the middle of reading an array, or after reading toplevel content, signals an error if ‘eof-error-p‘ is true, otherwise returns ‘eof-value’.
Define a bounded sequence in ‘in’ for use in ‘parse’ and ‘make-parser’ with a ‘start’ and ‘end’.
Serialize ‘element’ into JSON.
Returns a fresh string if ‘stream’ is nil, nil otherwise.
‘:stream’ like the ‘destination’ in ‘format’, or a ‘pathname’
‘:pretty’ if true, pretty-format the output
‘:replacer’ a function which takes a key and value as an argument, and returns t or nil, indicating whether the KV pair should be written.
- Optionally returns a second value, indicating the value to be stringified in place of the given value.
‘:coerce-key’ is a function of one argument, and is used to coerce object keys into non-nil string designators
‘:max-depth’ is an integer denoting the maximum depth to allow nesting during writing, or nil
see ‘coerce-key’
Write an array from a series of ‘values.’
As ‘write-array’, but using the currently bound ‘*writer*’.
Write the ‘double-float’ ‘x’ to ‘stream’, which must be a character output stream.
Write the ‘single-float’ ‘x’ to ‘stream’, which must be a character output stream.
Write an object ‘key’ to ‘writer’. Must currently be writing an object.
see ‘begin-object’
see ‘with-object’
As ‘write-key’, but using the currently bound ‘*writer*’.
Write an object value from a set of key-value pairs.
Ex.
(write-object writer
:speed 10
:colour :red)
As ‘write-object’, but using the currently bound ‘*writer*’.
Write an set of object properties to ‘writer’. Must currently be writing an object.
Ex.
(with-object writer
(write-properties writer
:speed 10
:colour :red)
(write-key writer :an-array)
(with-array writer
(write-value 42))
(write-properties writer :more 0 :after 42))
see ‘write-property’
see ‘write-object’
As ‘write-properties’, but using the currently bound ‘*writer*’.
As ‘write-property’, but using the currently bound ‘*writer*’.
As ‘write-value’, but using the currently bound ‘*writer*’.
Convenience function to write multiple ‘values’ to ‘writer’. Must be writing an array.
As ‘write-values’, but using the currently bound ‘*writer*’.
Coerce ‘key’ into a string designator, or ‘nil’ if ‘key’ is an unsuitable key.
Return a list of key definitions for ‘element’.
A key definition is a three-element list of the form
(name value &optional type)
name is the key name and will be coerced if not already a string
value is the value, and will be written per ‘write-value’
type is a type for the key, in order to handle ambiguous ‘nil’ interpretations.
Example return value:
((name :zulu)
(hobbies nil list))
Write a JSON value to ‘writer’. Specialize this function for customized JSON writing.
%string-output-stream
) character) ¶sb-gray
.
%string-output-stream
) string &optional start end) ¶sb-gray
.
Error signalled when reaching the end of file while parsing JSON.
Common error condition for all errors relating to reading/writing JSON.
simple-error
.
Error signalled when some limit in the JSON parser/writer has been exceeded.
:limit
This slot is read-only.
Error occuring while parsing JSON, in some cases with row/col information.
Error signalled when some limit in the JSON parser has been exceeded.
Error signalled when a recursive write is detected.
A recursive write is when ‘write-value’ is called from within ‘write-value’ with a value it has ’seen’ before.
:path
This slot is read-only.
Error signalled when there is an issue during writing JSON.
Error signalled when a limit on the JSON writer has been exceeded.
An incremental JSON parser.
see ‘make-parser’
see ‘next’
see ‘close-parser’
function
function
function
boolean
boolean
boolean
function
(integer 1 (17592186044416))
(min 1048576 (1- array-dimension-limit))
(or null function)
com.inuoe.jzon::%parser-state
(com.inuoe.jzon::%make-parser-state)
A JSON writer on which to call ‘write-value’, ‘begin-object’, etc.
Initarg | Value |
---|---|
:stream | (make-broadcast-stream) |
:coerce-key | (function coerce-key) |
:pretty | nil |
:replacer | nil |
:max-depth | 128 |
:stream
:coerce-key
:pretty
:replacer
integer
0
:max-depth
:close-action
A ’native’ atomic JSON value one can receive from ‘parse’.
t => true
nil => false
null => null
real => number
A ’native’ JSON value one can receive from ‘parse’.
vector => list
hash-table => object
see ‘json-atom’
Calculate line, column numbers by ‘step’ ping through the input ‘n’ times.
Returns true if ‘c’ is a control character per RFC 8259.
Create the step, read-string, and pos functions for ‘in’.
see ‘%step’
see ‘%read-string’
Create step, and read-string functions for the string ‘in’.
Create step, and read-string functions for the stream ‘in’.
Create step, and read-string functions for the string ‘in’.
Make a function for ’interning’ strings in a pool.
Reads an RFC 8259 number, starting with ‘c’.
Reads a JSON string step-wise using ‘step’ until an unescaped double-quote. Returns a ‘simple-string’ representing the string.
Skip whitespace, and optionally comments, depending on ‘%*allow-comments*’ Returns the next character.
Indent ‘writer’ depending on its depth, if it is set to pretty print.
Write a JSON atom per ‘json-atom’.
Write ‘string’ to ‘stream’ as a JSON string.
Write an object property/key value pair.
json-limit-error
)) ¶json-parse-error
)) ¶json-parse-error
)) ¶json-recursive-write-error
)) ¶fundamental-character-output-stream
.
:string
Jump to: | %
(
B C E F G M P R S W |
---|
Jump to: | %
(
B C E F G M P R S W |
---|
Jump to: | %
*
+
C S |
---|
Jump to: | %
*
+
C S |
---|
Jump to: | %
C E F J P R S T W |
---|
Jump to: | %
C E F J P R S T W |
---|