The persistent-variables Reference Manual

Table of Contents

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

The persistent-variables Reference Manual

This is the persistent-variables Reference Manual, version 1.0.0, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:10:02 2018 GMT+0.


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

1 Introduction

persistent-variables

1 Overview

Persistent variables can be serialized to and from streams.

They come with niceties, like restarts for failed serialization, late binding (loaded values are cached until the variable is defined), and a test suite.

(defpvar *my-account-password*) ;; Don't give it a value in the source file!

;; At the Repl: 
(setf *my-account-password* "the-password")
(with-open-file (s "/path/to/somewhere/else")
  (p-save s))

;; Later, at startup:
(with-open-file (s "/path/to/somewhere/else")
  (p-load s))

1.1 Features

2 Installation

2.1 Quick Lisp

Install Quick Lisp and then run:

(ql:quickload 'persistent-variables)

If you have problems, see the support section, and you may want to run the tests.

2.2 Gentoo

As root,

emerge persistent-variables

Once the emerge is finished, the package can be loaded using ASDF:

(asdf:operate 'asdf:load-op :persistent-variables)

If you have problems, see the support section, otherwise you may want to run the tests.

2.3 Ubunto

sudo apt-get install persistent-variables

Once the installation is finished, the package is loadable using ASDF:

(asdf:operate 'asdf:load-op :persistent-variables)

If you have problems, see the support section, otherwise you may want to run the tests.

2.4 Manual Installation

In summary: Untar the .tar package and then symlink the .asd files into a place where ASDF can find them.

  1. Untar the files where you want them to be. On windows download the .zip and unzip it instead, it's the same files.

  2. ASDF could be looking anywhere -- it depends on your setup. Run this in your lisp repl to get a clue as to where ASDF is seeking libraries:

    (mapcan #'funcall asdf:*default-source-registries*)
  3. Symlink the .asd files to the source directory. If you use windows, these instructions on symlink alternatives apply to you.

Once the files are in place, the package can be loaded with ASDF by:

(asdf:operate 'asdf:load-op :persistent-variables)

If you have problems, see the support section. If you don't have problems you may want to run the tests anyway, because you can.

2.5 Running the Tests

Once the system is loaded, it can be tested with asdf.

(asdf:operate 'asdf:test-op :persistent-variables)

This should display something like the following. There should be zero failures, if you have failures see the support section of this document.

RUNNING PERSISTENT-VARIABLE TESTS...
PERSISTENT-VARIABLE TEST RESULTS: 
     Tests: 8
   Success: 8
  Failures: 0

2.6 Getting Support

You can find support on this libraries website and/or github repository. Or you can email Warren Wilkinson.

3 License

Persister is distributed under the LGPL2 License.


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

2 Systems

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


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

2.1 persistent-variables

Author

Warren Wilkinson <warrenwilkinson@gmail.com>

License

lgpl2

Description

A library for persistent global variables.

Version

1.0.0

Source

persistent-variables.asd (file)

Component

persistent-variables.lisp (file)


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

3 Files

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


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

3.1 Lisp


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

3.1.1 persistent-variables.asd

Location

persistent-variables.asd

Systems

persistent-variables (system)


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

3.1.2 persistent-variables/persistent-variables.lisp

Parent

persistent-variables (system)

Location

persistent-variables.lisp

Packages

persistent-variables

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 persistent-variables

Source

persistent-variables.lisp (file)

Nickname

pv

Use List

common-lisp

Exported Definitions
Internal Definitions

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

5 Definitions

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


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

5.1 Exported definitions


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

5.1.1 Special variables

Special Variable: *default-set*
Package

persistent-variables

Source

persistent-variables.lisp (file)


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

5.1.2 Macros

Macro: defpvar NAME &optional VAL DOC SET

Define persistent variable, it’ll take it’s cached value if available.

Package

persistent-variables

Source

persistent-variables.lisp (file)


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

5.1.3 Functions

Function: persist NAME &optional SET

Add a variable to persistence serialization.

Package

persistent-variables

Source

persistent-variables.lisp (file)

Function: pv-load STREAM &optional SET

Load variable bindings from stream and set persistent-variables..

Package

persistent-variables

Source

persistent-variables.lisp (file)

Function: pv-save STREAM &optional SET

Save all defpvar values to stream.

Package

persistent-variables

Source

persistent-variables.lisp (file)

Function: unpersist NAME &optional SET

Remove a variable from persistence serialization.

Package

persistent-variables

Source

persistent-variables.lisp (file)


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

5.1.4 Generic functions

Generic Function: expression CONDITION
Package

persistent-variables

Methods
Method: expression (CONDITION unloadable-variable)
Source

persistent-variables.lisp (file)

Generic Function: name CONDITION
Package

persistent-variables

Methods
Method: name (CONDITION unloadable-variable)
Source

persistent-variables.lisp (file)

Generic Function: text CONDITION
Package

persistent-variables

Methods
Method: text (CONDITION unloadable-variable)
Source

persistent-variables.lisp (file)


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

5.1.5 Conditions

Condition: unloadable-variable ()
Package

persistent-variables

Source

persistent-variables.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

name (generic function)

Slot: text
Initargs

:text

Readers

text (generic function)

Slot: expression
Initargs

:expression

Readers

expression (generic function)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *loaded*

Store loaded values that are missing their corresponding variables.

Package

persistent-variables

Source

persistent-variables.lisp (file)

Special Variable: *persisted*
Package

persistent-variables

Source

persistent-variables.lisp (file)


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

5.2.2 Functions

Function: cached-string PACKAGE NAME &optional SET
Package

persistent-variables

Source

persistent-variables.lisp (file)

Function: cached-string-forget SYMBOL &optional SET
Package

persistent-variables

Source

persistent-variables.lisp (file)

Function: pv-read SYMBOL VALUE

Attempt to read a saved value.

Package

persistent-variables

Source

persistent-variables.lisp (file)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   P  
Index Entry  Section

F
File, Lisp, persistent-variables.asd: The persistent-variables<dot>asd file
File, Lisp, persistent-variables/persistent-variables.lisp: The persistent-variables/persistent-variables<dot>lisp file

L
Lisp File, persistent-variables.asd: The persistent-variables<dot>asd file
Lisp File, persistent-variables/persistent-variables.lisp: The persistent-variables/persistent-variables<dot>lisp file

P
persistent-variables.asd: The persistent-variables<dot>asd file
persistent-variables/persistent-variables.lisp: The persistent-variables/persistent-variables<dot>lisp file

Jump to:   F   L   P  

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

A.2 Functions

Jump to:   C   D   E   F   G   M   N   P   T   U  
Index Entry  Section

C
cached-string: Internal functions
cached-string-forget: Internal functions

D
defpvar: Exported macros

E
expression: Exported generic functions
expression: Exported generic functions

F
Function, cached-string: Internal functions
Function, cached-string-forget: Internal functions
Function, persist: Exported functions
Function, pv-load: Exported functions
Function, pv-read: Internal functions
Function, pv-save: Exported functions
Function, unpersist: Exported functions

G
Generic Function, expression: Exported generic functions
Generic Function, name: Exported generic functions
Generic Function, text: Exported generic functions

M
Macro, defpvar: Exported macros
Method, expression: Exported generic functions
Method, name: Exported generic functions
Method, text: Exported generic functions

N
name: Exported generic functions
name: Exported generic functions

P
persist: Exported functions
pv-load: Exported functions
pv-read: Internal functions
pv-save: Exported functions

T
text: Exported generic functions
text: Exported generic functions

U
unpersist: Exported functions

Jump to:   C   D   E   F   G   M   N   P   T   U  

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

A.3 Variables

Jump to:   *  
E   N   S   T  
Index Entry  Section

*
*default-set*: Exported special variables
*loaded*: Internal special variables
*persisted*: Internal special variables

E
expression: Exported conditions

N
name: Exported conditions

S
Slot, expression: Exported conditions
Slot, name: Exported conditions
Slot, text: Exported conditions
Special Variable, *default-set*: Exported special variables
Special Variable, *loaded*: Internal special variables
Special Variable, *persisted*: Internal special variables

T
text: Exported conditions

Jump to:   *  
E   N   S   T  

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

A.4 Data types

Jump to:   C   P   S   U  
Index Entry  Section

C
Condition, unloadable-variable: Exported conditions

P
Package, persistent-variables: The persistent-variables package
persistent-variables: The persistent-variables system
persistent-variables: The persistent-variables package

S
System, persistent-variables: The persistent-variables system

U
unloadable-variable: Exported conditions

Jump to:   C   P   S   U