The universal-config Reference Manual

This is the universal-config Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 07:01:43 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 universal-config

Library to provide a universal configuration layer.

Maintainer

Nicolas Hafner <>

Author

Nicolas Hafner <>

License

Artistic

Version

1.0.0

Dependencies
  • cl-ppcre (system).
  • parse-float (system).
Source

universal-config.asd.

Child Components

3 Modules

Modules are listed depth-first from the system components tree.


3.1 universal-config/outputs

Dependency

output.lisp (file).

Source

universal-config.asd.

Parent Component

universal-config (system).

Child Components

4 Files

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


4.1 Lisp


4.1.1 universal-config/universal-config.asd

Source

universal-config.asd.

Parent Component

universal-config (system).

ASDF Systems

universal-config.

Packages

org.tymoonnext.universal-config.asdf.


4.1.2 universal-config/package.lisp

Source

universal-config.asd.

Parent Component

universal-config (system).

Packages

4.1.3 universal-config/access.lisp

Dependency

package.lisp (file).

Source

universal-config.asd.

Parent Component

universal-config (system).

Public Interface

4.1.4 universal-config/transform.lisp

Dependency

access.lisp (file).

Source

universal-config.asd.

Parent Component

universal-config (system).

Public Interface
Internals

4.1.5 universal-config/output.lisp

Dependency

transform.lisp (file).

Source

universal-config.asd.

Parent Component

universal-config (system).

Public Interface
Internals
  • %load (generic function).
  • %save (generic function).

4.1.6 universal-config/outputs/lisp.lisp

Source

universal-config.asd.

Parent Component

outputs (module).

Internals

4.1.7 universal-config/outputs/json.lisp

Source

universal-config.asd.

Parent Component

outputs (module).

Internals

5 Packages

Packages are listed by definition order.


5.1 universal-config-lisp

Source

package.lisp.

Nicknames
  • org.tymoonnext.universal-config.lisp
  • uc-lisp
Use List
Internals

5.2 universal-config

Source

package.lisp.

Nicknames
  • org.tymoonnext.universal-config
  • uc
Use List
  • common-lisp.
  • parse-float.
Used By List
Public Interface
Internals

5.3 org.tymoonnext.universal-config.asdf

Source

universal-config.asd.

Use List
  • asdf/interface.
  • common-lisp.

5.4 universal-config-json

Source

package.lisp.

Nicknames
  • org.tymoonnext.universal-config.json
  • uc-json
Use List
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Special variables

Special Variable: *augment-missing-places*

If set to non-NIL, (SETF (CONFIG-TREE ..) ..) will attempt to augment missing places.

Package

universal-config.

Source

access.lisp.

Special Variable: *config*

The global configuration storage variable.

Package

universal-config.

Source

access.lisp.

Special Variable: *fallback-deserializer*

Fallback function used when no deserializer method matched.

Useful for applying deserializers specific to the input format.

Package

universal-config.

Source

transform.lisp.

Special Variable: *fallback-serializer*

Fallback function used when no serializer method matched.

Useful for applying serializers specific to the output format.

Package

universal-config.

Source

transform.lisp.

Special Variable: *output-format*

The default output format to use.

Package

universal-config.

Source

output.lisp.

Special Variable: *serialize-hash-tables*

Whether to serialize hash-tables into a vector and a hash-table.

This is necessary for most output formats as there is no differentiation made between hash-table tests. Serializing them will ensure that the proper test can be restored upon deserializing.

Package

universal-config.

Source

transform.lisp.

Special Variable: *serialize-lists*

Whether to serialize lists into vector representation.

This is necessary for most output formats as there are no two representations of list- or vector-like structures.

Package

universal-config.

Source

transform.lisp.

Special Variable: *serialize-numbers*

Whether to serialize numbers into string representation.

This is necessary for many output formats as they do not support the variety of number types lisp provides (ratios, floats, complex numbers).

Package

universal-config.

Source

transform.lisp.

Special Variable: *serialize-symbols*

Whether symbols should be serialized into string representation.

Note that symbol plists are not serialized into strings.

Package

universal-config.

Source

transform.lisp.


6.1.2 Macros

Macro: define-class-de/serializer (class &rest slotdefs)

Shorthand macro to define de/serializer methods for a class and the specified slots.

CLASS — A class type.
SLOTDEFS ::= SLOTDEF*
SLOTDEF ::= SLOT-SYMBOL | (SLOT-SYMBOL INITARG-SYMBOL)

Package

universal-config.

Source

transform.lisp.

Macro: define-deserializer ((object-type object-var &optional expect-vector) &body body)

Define a new OBJECT-TYPE to deserialize into a usable representation.

If EXPECT-VECTOR is non-NIL, the bound OBJECT-VAR will be of type VECTOR.

Package

universal-config.

Source

transform.lisp.

Macro: define-load-format (name (streamvar) &body body)

Define a format of NAME to load an object from a stream.

Package

universal-config.

Source

output.lisp.

Macro: define-save-format (name (streamvar objectvar) &body body)

Define a format of NAME to save an object to a stream.

Package

universal-config.

Source

output.lisp.

Macro: define-serializer ((object-type object-var &optional return-vector) &body body)

Define an OBJECT-TYPE to be serialized. The expected value of this function should be one of HASH-TABLE, VECTOR, STRING or NUMBER.

If RETURN-VECTOR is non-NIL, the object returned should be of type VECTOR.

Package

universal-config.

Source

transform.lisp.

Macro: define-string-deserializer ((ident-char string) &body body)

Define a new IDENT-CHAR handler to deserialize a STRING with.

Package

universal-config.

Source

transform.lisp.

Macro: define-string-serializer ((ident-char object-type object-var) &body body)

Defines an OBJECT-TYPE to be serialized to a string.
To discern string serialized objects, an IDENT-CHAR is needed.

Package

universal-config.

Source

transform.lisp.

Macro: with-configuration ((configuration) &body body)

Establishes a configuration context.

Package

universal-config.

Source

access.lisp.


6.1.3 Ordinary functions

Function: config-tree (&rest accessors)

Retrieve a value from the configuration.

Package

universal-config.

Source

access.lisp.

Function: (setf config-tree) (&rest accessors)

Set a value in the configuration.

If *AUGMENT-MISSING-PLACES* is non-NIL, missing path parts will be attempted to be augmented. The container object is chosen through MAKE-CONTAINER.

Package

universal-config.

Source

access.lisp.

Function: escape (string &optional char)

Escape all instances of CHAR in the string that match CHAR with a backslash.

Package

universal-config.

Source

transform.lisp.

Function: load-configuration (path &key format if-does-not-exist)

Load the configuration from PATH with the given FORMAT.

Package

universal-config.

Source

output.lisp.

Function: save-configuration (path &key format object)

Save the configuration OBJECT to PATH using the given FORMAT.

Package

universal-config.

Source

output.lisp.

Function: set-config-tree (accessors value)

Sets the place indicated by the ACCESSORS list to VALUE if possible. See (SETF CONFIG-TREE)

Package

universal-config.

Source

access.lisp.

Function: split-escaped (string &optional char)

Split the string by CHAR minding backslash escaped instances.

Package

universal-config.

Source

transform.lisp.

Function: unescape (string &optional char)

Unescape all backslash escaped instances of CHAR.

Package

universal-config.

Source

transform.lisp.


6.1.4 Generic functions

Generic Function: access (config-object accessor &optional default)

Universal object accessor.
Returns two values, the first being the accessed value or the supplied default, the second being T if the requested place was found or NIL if the default is returned.

Package

universal-config.

Source

access.lisp.

Methods
Method: access ((o list) (pos fixnum) &optional default)
Method: access ((o hash-table) accessor &optional default)
Method: access ((o sequence) (pos fixnum) &optional default)
Method: access ((o array) (pos fixnum) &optional default)
Method: access ((o array) (scr list) &optional default)
Method: access ((o standard-object) (slot symbol) &optional default)
Method: access ((null null) accessor &optional default)
Generic Function: (setf access) (config-object accessor)

Universal object setter.

Package

universal-config.

Source

access.lisp.

Methods
Method: (setf access) ((o list) (pos fixnum))
Method: (setf access) ((o hash-table) accessor)
Method: (setf access) ((o sequence) (pos fixnum))
Method: (setf access) ((o array) (pos fixnum))
Method: (setf access) ((o array) (scr list))
Method: (setf access) ((o standard-object) (slot symbol))
Method: (setf access) ((null null) accessor)
Generic Reader: accessor (condition)
Generic Writer: (setf accessor) (condition)
Package

universal-config.

Methods
Reader Method: accessor ((condition augmenting-place))
Writer Method: (setf accessor) ((condition augmenting-place))
Source

access.lisp.

Target Slot

%accessor.

Reader Method: accessor ((condition inexistent-place))
Writer Method: (setf accessor) ((condition inexistent-place))
Source

access.lisp.

Target Slot

%accessor.

Generic Function: deserialize (object)

Deserialize an OBJECT into a usable configuration object.

Package

universal-config.

Source

transform.lisp.

Methods
Method: deserialize ((string string))
Method: deserialize ((vector vector))
Method: deserialize ((list list))
Method: deserialize (object)
Generic Function: make-container (accessor)

Attempts to create a fitting container for an accessor.

Package

universal-config.

Source

access.lisp.

Methods
Method: make-container ((accessor fixnum))
Method: make-container ((accessor list))
Method: make-container ((accessor symbol))
Method: make-container (accessor)
Generic Reader: object (condition)
Generic Writer: (setf object) (condition)
Package

universal-config.

Methods
Reader Method: object ((condition augmenting-place))
Writer Method: (setf object) ((condition augmenting-place))
Source

access.lisp.

Target Slot

%object.

Reader Method: object ((condition inexistent-place))
Writer Method: (setf object) ((condition inexistent-place))
Source

access.lisp.

Target Slot

%object.

Generic Function: serialize (object)

Serialize the given object recursively into a format that is ready for outputting.

Package

universal-config.

Source

transform.lisp.

Methods
Method: serialize ((pathname pathname))
Method: serialize ((number number))
Method: serialize ((symbol symbol))
Method: serialize ((table hash-table))
Method: serialize ((list list))
Method: serialize ((vector vector))
Method: serialize ((string string))
Method: serialize (object)

6.1.5 Conditions

Condition: augmenting-place

Warning condition signalled when a place is augmented automatically.

Package

universal-config.

Source

access.lisp.

Direct superclasses

warning.

Direct methods
Direct slots
Slot: %accessor
Initargs

:accessor

Readers

accessor.

Writers

(setf accessor).

Slot: %object
Initargs

:object

Readers

object.

Writers

(setf object).

Condition: inexistent-place

Error condition signalled when attempting to set an inexistent place.

Package

universal-config.

Source

access.lisp.

Direct superclasses

error.

Direct methods
Direct slots
Slot: %accessor
Initargs

:accessor

Readers

accessor.

Writers

(setf accessor).

Slot: %object
Initargs

:object

Readers

object.

Writers

(setf object).


6.2 Internals


6.2.1 Special variables

Special Variable: *level*
Package

universal-config-json.

Source

json.lisp.

Special Variable: *tab-size*
Package

universal-config-json.

Source

json.lisp.

Special Variable: +ignore+
Package

universal-config-lisp.

Source

lisp.lisp.

Special Variable: +ignore+
Package

universal-config-json.

Source

json.lisp.

Special Variable: +stop+
Package

universal-config-lisp.

Source

lisp.lisp.

Special Variable: +stop+
Package

universal-config-json.

Source

json.lisp.


6.2.2 Macros

Macro: with-hash-table-syntax (() &body body)
Package

universal-config-lisp.

Source

lisp.lisp.

Macro: with-json-syntax (() &body body)
Package

universal-config-json.

Source

json.lisp.


6.2.3 Ordinary functions

Function: hash-table-printer (stream table)
Package

universal-config-lisp.

Source

lisp.lisp.

Function: hash-table-printer (stream table)
Package

universal-config-json.

Source

json.lisp.

Function: hash-table-reader (stream subchar)
Package

universal-config-lisp.

Source

lisp.lisp.

Function: hash-table-reader (stream subchar)
Package

universal-config-json.

Source

json.lisp.

Function: indent (stream)
Package

universal-config-json.

Source

json.lisp.

Function: make-return (val)
Package

universal-config-lisp.

Source

lisp.lisp.

Function: make-return (val)
Package

universal-config-json.

Source

json.lisp.

Function: string-printer (stream string)
Package

universal-config-json.

Source

json.lisp.

Function: symbol-printer (stream symbol)
Package

universal-config-json.

Source

json.lisp.

Function: vector-printer (stream vector)
Package

universal-config-json.

Source

json.lisp.

Function: vector-reader (stream subchar)
Package

universal-config-json.

Source

json.lisp.


6.2.4 Generic functions

Generic Function: %load (format path)
Package

universal-config.

Source

output.lisp.

Methods
Method: %load ((format0 (eql :json)) stream)
Source

json.lisp.

Method: %load ((format0 (eql :lisp)) stream)
Source

lisp.lisp.

Generic Function: %save (format path object)
Package

universal-config.

Source

output.lisp.

Methods
Method: %save ((format0 (eql :json)) stream object)
Source

json.lisp.

Method: %save ((format0 (eql :lisp)) stream object)
Source

lisp.lisp.

Generic Function: deserialize-object (type object)

Deserialize an OBJECT of TYPE into its usable representation.

OBJECT itself will be one of HASH-TABLE, VECTOR, STRING or NUMBER.

Package

universal-config.

Source

transform.lisp.

Methods
Method: deserialize-object ((type1 (eql :hash-table)) object0)
Method: deserialize-object ((type1 (eql :vector)) object0)
Method: deserialize-object ((type1 (eql :list)) object0)
Generic Function: deserialize-string (ident-char string)

Deserialize a STRING according to the IDENT-CHAR.

Package

universal-config.

Source

transform.lisp.

Methods
Method: deserialize-string ((char0 (eql #\p)) string)
Method: deserialize-string ((char0 (eql #\c)) string)
Method: deserialize-string ((char0 (eql #\f)) string)
Method: deserialize-string ((char0 (eql #\r)) string)
Method: deserialize-string ((char0 (eql #\i)) string)
Method: deserialize-string ((char0 (eql #\+)) string)
Method: deserialize-string ((char0 (eql #\-)) string)

Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   C   D   E   F   G   H   I   L   M   O   S   U   V   W  
Index Entry  Section

%
%load: Private generic functions
%load: Private generic functions
%load: Private generic functions
%save: Private generic functions
%save: Private generic functions
%save: Private generic functions

(
(setf access): Public generic functions
(setf access): Public generic functions
(setf access): Public generic functions
(setf access): Public generic functions
(setf access): Public generic functions
(setf access): Public generic functions
(setf access): Public generic functions
(setf access): Public generic functions
(setf accessor): Public generic functions
(setf accessor): Public generic functions
(setf accessor): Public generic functions
(setf config-tree): Public ordinary functions
(setf object): Public generic functions
(setf object): Public generic functions
(setf object): Public generic functions

A
access: Public generic functions
access: Public generic functions
access: Public generic functions
access: Public generic functions
access: Public generic functions
access: Public generic functions
access: Public generic functions
access: Public generic functions
accessor: Public generic functions
accessor: Public generic functions
accessor: Public generic functions

C
config-tree: Public ordinary functions

D
define-class-de/serializer: Public macros
define-deserializer: Public macros
define-load-format: Public macros
define-save-format: Public macros
define-serializer: Public macros
define-string-deserializer: Public macros
define-string-serializer: Public macros
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize: Public generic functions
deserialize-object: Private generic functions
deserialize-object: Private generic functions
deserialize-object: Private generic functions
deserialize-object: Private generic functions
deserialize-string: Private generic functions
deserialize-string: Private generic functions
deserialize-string: Private generic functions
deserialize-string: Private generic functions
deserialize-string: Private generic functions
deserialize-string: Private generic functions
deserialize-string: Private generic functions
deserialize-string: Private generic functions

E
escape: Public ordinary functions

F
Function, (setf config-tree): Public ordinary functions
Function, config-tree: Public ordinary functions
Function, escape: Public ordinary functions
Function, hash-table-printer: Private ordinary functions
Function, hash-table-printer: Private ordinary functions
Function, hash-table-reader: Private ordinary functions
Function, hash-table-reader: Private ordinary functions
Function, indent: Private ordinary functions
Function, load-configuration: Public ordinary functions
Function, make-return: Private ordinary functions
Function, make-return: Private ordinary functions
Function, save-configuration: Public ordinary functions
Function, set-config-tree: Public ordinary functions
Function, split-escaped: Public ordinary functions
Function, string-printer: Private ordinary functions
Function, symbol-printer: Private ordinary functions
Function, unescape: Public ordinary functions
Function, vector-printer: Private ordinary functions
Function, vector-reader: Private ordinary functions

G
Generic Function, %load: Private generic functions
Generic Function, %save: Private generic functions
Generic Function, (setf access): Public generic functions
Generic Function, (setf accessor): Public generic functions
Generic Function, (setf object): Public generic functions
Generic Function, access: Public generic functions
Generic Function, accessor: Public generic functions
Generic Function, deserialize: Public generic functions
Generic Function, deserialize-object: Private generic functions
Generic Function, deserialize-string: Private generic functions
Generic Function, make-container: Public generic functions
Generic Function, object: Public generic functions
Generic Function, serialize: Public generic functions

H
hash-table-printer: Private ordinary functions
hash-table-printer: Private ordinary functions
hash-table-reader: Private ordinary functions
hash-table-reader: Private ordinary functions

I
indent: Private ordinary functions

L
load-configuration: Public ordinary functions

M
Macro, define-class-de/serializer: Public macros
Macro, define-deserializer: Public macros
Macro, define-load-format: Public macros
Macro, define-save-format: Public macros
Macro, define-serializer: Public macros
Macro, define-string-deserializer: Public macros
Macro, define-string-serializer: Public macros
Macro, with-configuration: Public macros
Macro, with-hash-table-syntax: Private macros
Macro, with-json-syntax: Private macros
make-container: Public generic functions
make-container: Public generic functions
make-container: Public generic functions
make-container: Public generic functions
make-container: Public generic functions
make-return: Private ordinary functions
make-return: Private ordinary functions
Method, %load: Private generic functions
Method, %load: Private generic functions
Method, %save: Private generic functions
Method, %save: Private generic functions
Method, (setf access): Public generic functions
Method, (setf access): Public generic functions
Method, (setf access): Public generic functions
Method, (setf access): Public generic functions
Method, (setf access): Public generic functions
Method, (setf access): Public generic functions
Method, (setf access): Public generic functions
Method, (setf accessor): Public generic functions
Method, (setf accessor): Public generic functions
Method, (setf object): Public generic functions
Method, (setf object): Public generic functions
Method, access: Public generic functions
Method, access: Public generic functions
Method, access: Public generic functions
Method, access: Public generic functions
Method, access: Public generic functions
Method, access: Public generic functions
Method, access: Public generic functions
Method, accessor: Public generic functions
Method, accessor: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize: Public generic functions
Method, deserialize-object: Private generic functions
Method, deserialize-object: Private generic functions
Method, deserialize-object: Private generic functions
Method, deserialize-string: Private generic functions
Method, deserialize-string: Private generic functions
Method, deserialize-string: Private generic functions
Method, deserialize-string: Private generic functions
Method, deserialize-string: Private generic functions
Method, deserialize-string: Private generic functions
Method, deserialize-string: Private generic functions
Method, make-container: Public generic functions
Method, make-container: Public generic functions
Method, make-container: Public generic functions
Method, make-container: Public generic functions
Method, object: Public generic functions
Method, object: Public generic functions
Method, serialize: Public generic functions
Method, serialize: Public generic functions
Method, serialize: Public generic functions
Method, serialize: Public generic functions
Method, serialize: Public generic functions
Method, serialize: Public generic functions
Method, serialize: Public generic functions
Method, serialize: Public generic functions

O
object: Public generic functions
object: Public generic functions
object: Public generic functions

S
save-configuration: Public ordinary functions
serialize: Public generic functions
serialize: Public generic functions
serialize: Public generic functions
serialize: Public generic functions
serialize: Public generic functions
serialize: Public generic functions
serialize: Public generic functions
serialize: Public generic functions
serialize: Public generic functions
set-config-tree: Public ordinary functions
split-escaped: Public ordinary functions
string-printer: Private ordinary functions
symbol-printer: Private ordinary functions

U
unescape: Public ordinary functions

V
vector-printer: Private ordinary functions
vector-reader: Private ordinary functions

W
with-configuration: Public macros
with-hash-table-syntax: Private macros
with-json-syntax: Private macros


A.3 Variables

Jump to:   %   *   +  
S  
Index Entry  Section

%
%accessor: Public conditions
%accessor: Public conditions
%object: Public conditions
%object: Public conditions

*
*augment-missing-places*: Public special variables
*config*: Public special variables
*fallback-deserializer*: Public special variables
*fallback-serializer*: Public special variables
*level*: Private special variables
*output-format*: Public special variables
*serialize-hash-tables*: Public special variables
*serialize-lists*: Public special variables
*serialize-numbers*: Public special variables
*serialize-symbols*: Public special variables
*tab-size*: Private special variables

+
+ignore+: Private special variables
+ignore+: Private special variables
+stop+: Private special variables
+stop+: Private special variables

S
Slot, %accessor: Public conditions
Slot, %accessor: Public conditions
Slot, %object: Public conditions
Slot, %object: Public conditions
Special Variable, *augment-missing-places*: Public special variables
Special Variable, *config*: Public special variables
Special Variable, *fallback-deserializer*: Public special variables
Special Variable, *fallback-serializer*: Public special variables
Special Variable, *level*: Private special variables
Special Variable, *output-format*: Public special variables
Special Variable, *serialize-hash-tables*: Public special variables
Special Variable, *serialize-lists*: Public special variables
Special Variable, *serialize-numbers*: Public special variables
Special Variable, *serialize-symbols*: Public special variables
Special Variable, *tab-size*: Private special variables
Special Variable, +ignore+: Private special variables
Special Variable, +ignore+: Private special variables
Special Variable, +stop+: Private special variables
Special Variable, +stop+: Private special variables


A.4 Data types

Jump to:   A   C   F   I   J   L   M   O   P   S   T   U  
Index Entry  Section

A
access.lisp: The universal-config/access․lisp file
augmenting-place: Public conditions

C
Condition, augmenting-place: Public conditions
Condition, inexistent-place: Public conditions

F
File, access.lisp: The universal-config/access․lisp file
File, json.lisp: The universal-config/outputs/json․lisp file
File, lisp.lisp: The universal-config/outputs/lisp․lisp file
File, output.lisp: The universal-config/output․lisp file
File, package.lisp: The universal-config/package․lisp file
File, transform.lisp: The universal-config/transform․lisp file
File, universal-config.asd: The universal-config/universal-config․asd file

I
inexistent-place: Public conditions

J
json.lisp: The universal-config/outputs/json․lisp file

L
lisp.lisp: The universal-config/outputs/lisp․lisp file

M
Module, outputs: The universal-config/outputs module

O
org.tymoonnext.universal-config.asdf: The org․tymoonnext․universal-config․asdf package
output.lisp: The universal-config/output․lisp file
outputs: The universal-config/outputs module

P
Package, org.tymoonnext.universal-config.asdf: The org․tymoonnext․universal-config․asdf package
Package, universal-config: The universal-config package
Package, universal-config-json: The universal-config-json package
Package, universal-config-lisp: The universal-config-lisp package
package.lisp: The universal-config/package․lisp file

S
System, universal-config: The universal-config system

T
transform.lisp: The universal-config/transform․lisp file

U
universal-config: The universal-config system
universal-config: The universal-config package
universal-config-json: The universal-config-json package
universal-config-lisp: The universal-config-lisp package
universal-config.asd: The universal-config/universal-config․asd file