The st-json Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The st-json Reference Manual

This is the st-json Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:37:02 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Systems

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


Previous: , Up: Systems   [Contents][Index]

1.1 st-json

Author

Marijn Haverbeke <marijnh@gmail.com>

License

BSD

Description

JSON in- and output

Source

st-json.asd (file)

Component

st-json.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

2 Files

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


Previous: , Up: Files   [Contents][Index]

2.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.1 st-json.asd

Location

st-json.asd

Systems

st-json (system)


Previous: , Up: Lisp files   [Contents][Index]

2.1.2 st-json/st-json.lisp

Parent

st-json (system)

Location

st-json.lisp

Packages

st-json

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

3 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

3.1 st-json

Source

st-json.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

4.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.1 Special variables

Special Variable: *decode-objects-as*

Valid values: :jso :hashtable
Controls how js objects should be decoded. :jso means decode to internal struct which can be processed by getjso, mapjso etc. :hashtable means decode as hash tables.

Package

st-json

Source

st-json.lisp (file)

Special Variable: *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.

Package

st-json

Source

st-json.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.2 Macros

Macro: getjso* KEYS JSO
Package

st-json

Source

st-json.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.3 Functions

Function: as-json-bool VALUE

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

Package

st-json

Source

st-json.lisp (file)

Function: from-json-bool VALUE

Convert :true or :false to its boolean equivalent.

Package

st-json

Source

st-json.lisp (file)

Function: getjso KEY MAP

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

Package

st-json

Source

st-json.lisp (file)

Writer

(setf getjso) (function)

Function: (setf getjso) VAL KEY MAP

Store a value in a JS object.

Package

st-json

Source

st-json.lisp (file)

Reader

getjso (function)

Function: jso &rest FIELDS

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

Package

st-json

Source

st-json.lisp (file)

Function: mapjso FUNC MAP

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

Package

st-json

Source

st-json.lisp (file)

Function: 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.

Package

st-json

Source

st-json.lisp (file)

Function: read-json-from-string STRING &key START END JUNK-ALLOWED-P
Package

st-json

Source

st-json.lisp (file)

Function: write-json ELEMENT STREAM

Write a value’s JSON representation to a stream.

Package

st-json

Source

st-json.lisp (file)

Function: write-json-to-string ELEMENT

Write a value’s JSON representation to a string.

Package

st-json

Source

st-json.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.4 Generic functions

Generic Function: read-json IN &optional JUNK-ALLOWED-P

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

Package

st-json

Source

st-json.lisp (file)

Methods
Method: read-json (IN string) &optional JUNK-ALLOWED-P
Method: read-json (IN stream) &optional JUNK-ALLOWED-P
Generic Function: write-json-element ELEMENT STREAM

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

Package

st-json

Source

st-json.lisp (file)

Methods
Method: write-json-element (ELEMENT list) STREAM
Method: write-json-element (ELEMENT jso) STREAM
Method: write-json-element (ELEMENT hash-table) STREAM
Method: write-json-element (ELEMENT real) STREAM
Method: write-json-element (ELEMENT integer) STREAM
Method: write-json-element (ELEMENT string) STREAM
Method: write-json-element (ELEMENT symbol) STREAM
Method: write-json-element ELEMENT STREAM

Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.5 Conditions

Condition: json-eof-error ()
Package

st-json

Source

st-json.lisp (file)

Direct superclasses

json-parse-error (condition)

Condition: json-error ()
Package

st-json

Source

st-json.lisp (file)

Direct superclasses

simple-error (condition)

Direct subclasses
Condition: json-parse-error ()
Package

st-json

Source

st-json.lisp (file)

Direct superclasses

json-error (condition)

Direct subclasses

json-eof-error (condition)

Condition: json-type-error ()
Package

st-json

Source

st-json.lisp (file)

Direct superclasses

json-error (condition)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.6 Structures

Structure: jso ()
Package

st-json

Source

st-json.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods

write-json-element (method)

Direct slots
Slot: alist
Readers

jso-alist (function)

Writers

(setf jso-alist) (function)


Previous: , Up: Exported definitions   [Contents][Index]

4.1.7 Types

Type: json-bool ()
Package

st-json

Source

st-json.lisp (file)

Type: json-null ()
Package

st-json

Source

st-json.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

4.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.1 Special variables

Special Variable: *optimize*
Package

st-json

Source

st-json.lisp (file)

Special Variable: *reading-slot-name*
Package

st-json

Source

st-json.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.2 Functions

Function: at-eof STREAM
Package

st-json

Source

st-json.lisp (file)

Function: copy-jso INSTANCE
Package

st-json

Source

st-json.lisp (file)

Function: ends-atom CHAR
Package

st-json

Source

st-json.lisp (file)

Function: gather-comma-separated STREAM END-CHAR OBJ-NAME GATHER-FUNC
Package

st-json

Source

st-json.lisp (file)

Function: is-whitespace CHAR
Package

st-json

Source

st-json.lisp (file)

Function: jso-alist INSTANCE
Function: (setf jso-alist) VALUE INSTANCE
Package

st-json

Source

st-json.lisp (file)

Function: jso-p OBJECT
Package

st-json

Source

st-json.lisp (file)

Function: looks-like-a-number STRING
Package

st-json

Source

st-json.lisp (file)

Function: make-jso &key (ALIST ALIST)
Package

st-json

Source

st-json.lisp (file)

Function: raise TYPE FORMAT &rest ARGS
Package

st-json

Source

st-json.lisp (file)

Function: read-json-atom STREAM
Package

st-json

Source

st-json.lisp (file)

Function: read-json-element STREAM
Package

st-json

Source

st-json.lisp (file)

Function: read-json-list STREAM
Package

st-json

Source

st-json.lisp (file)

Function: read-json-object STREAM
Package

st-json

Source

st-json.lisp (file)

Function: read-json-string STREAM
Package

st-json

Source

st-json.lisp (file)

Function: skip-whitespace STREAM
Package

st-json

Source

st-json.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

4.2.3 Conditions

Condition: json-write-error ()
Package

st-json

Source

st-json.lisp (file)

Direct superclasses

json-error (condition)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, st-json.asd: The st-json<dot>asd file
File, Lisp, st-json/st-json.lisp: The st-json/st-json<dot>lisp file

L
Lisp File, st-json.asd: The st-json<dot>asd file
Lisp File, st-json/st-json.lisp: The st-json/st-json<dot>lisp file

S
st-json.asd: The st-json<dot>asd file
st-json/st-json.lisp: The st-json/st-json<dot>lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   E   F   G   I   J   L   M   R   S   W  
Index Entry  Section

(
(setf getjso): Exported functions
(setf jso-alist): Internal functions

A
as-json-bool: Exported functions
at-eof: Internal functions

C
copy-jso: Internal functions

E
ends-atom: Internal functions

F
from-json-bool: Exported functions
Function, (setf getjso): Exported functions
Function, (setf jso-alist): Internal functions
Function, as-json-bool: Exported functions
Function, at-eof: Internal functions
Function, copy-jso: Internal functions
Function, ends-atom: Internal functions
Function, from-json-bool: Exported functions
Function, gather-comma-separated: Internal functions
Function, getjso: Exported functions
Function, is-whitespace: Internal functions
Function, jso: Exported functions
Function, jso-alist: Internal functions
Function, jso-p: Internal functions
Function, looks-like-a-number: Internal functions
Function, make-jso: Internal functions
Function, mapjso: Exported functions
Function, raise: Internal functions
Function, read-json-as-type: Exported functions
Function, read-json-atom: Internal functions
Function, read-json-element: Internal functions
Function, read-json-from-string: Exported functions
Function, read-json-list: Internal functions
Function, read-json-object: Internal functions
Function, read-json-string: Internal functions
Function, skip-whitespace: Internal functions
Function, write-json: Exported functions
Function, write-json-to-string: Exported functions

G
gather-comma-separated: Internal functions
Generic Function, read-json: Exported generic functions
Generic Function, write-json-element: Exported generic functions
getjso: Exported functions
getjso*: Exported macros

I
is-whitespace: Internal functions

J
jso: Exported functions
jso-alist: Internal functions
jso-p: Internal functions

L
looks-like-a-number: Internal functions

M
Macro, getjso*: Exported macros
make-jso: Internal functions
mapjso: Exported functions
Method, read-json: Exported generic functions
Method, read-json: Exported generic functions
Method, write-json-element: Exported generic functions
Method, write-json-element: Exported generic functions
Method, write-json-element: Exported generic functions
Method, write-json-element: Exported generic functions
Method, write-json-element: Exported generic functions
Method, write-json-element: Exported generic functions
Method, write-json-element: Exported generic functions
Method, write-json-element: Exported generic functions

R
raise: Internal functions
read-json: Exported generic functions
read-json: Exported generic functions
read-json: Exported generic functions
read-json-as-type: Exported functions
read-json-atom: Internal functions
read-json-element: Internal functions
read-json-from-string: Exported functions
read-json-list: Internal functions
read-json-object: Internal functions
read-json-string: Internal functions

S
skip-whitespace: Internal functions

W
write-json: Exported functions
write-json-element: Exported generic functions
write-json-element: Exported generic functions
write-json-element: Exported generic functions
write-json-element: Exported generic functions
write-json-element: Exported generic functions
write-json-element: Exported generic functions
write-json-element: Exported generic functions
write-json-element: Exported generic functions
write-json-element: Exported generic functions
write-json-to-string: Exported functions

Jump to:   (  
A   C   E   F   G   I   J   L   M   R   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
A   S  
Index Entry  Section

*
*decode-objects-as*: Exported special variables
*optimize*: Internal special variables
*reading-slot-name*: Internal special variables
*script-tag-hack*: Exported special variables

A
alist: Exported structures

S
Slot, alist: Exported structures
Special Variable, *decode-objects-as*: Exported special variables
Special Variable, *optimize*: Internal special variables
Special Variable, *reading-slot-name*: Internal special variables
Special Variable, *script-tag-hack*: Exported special variables

Jump to:   *  
A   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   J   P   S   T  
Index Entry  Section

C
Condition, json-eof-error: Exported conditions
Condition, json-error: Exported conditions
Condition, json-parse-error: Exported conditions
Condition, json-type-error: Exported conditions
Condition, json-write-error: Internal conditions

J
jso: Exported structures
json-bool: Exported types
json-eof-error: Exported conditions
json-error: Exported conditions
json-null: Exported types
json-parse-error: Exported conditions
json-type-error: Exported conditions
json-write-error: Internal conditions

P
Package, st-json: The st-json package

S
st-json: The st-json system
st-json: The st-json package
Structure, jso: Exported structures
System, st-json: The st-json system

T
Type, json-bool: Exported types
Type, json-null: Exported types

Jump to:   C   J   P   S   T