The pvars Reference Manual

Table of Contents

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

The pvars Reference Manual

This is the pvars Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 17:29:21 2021 GMT+0.


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

1 Introduction

pvars

pvars is a small library to easily define persistent variables. Use them as normal variables, but they are actually persistent.

(use-package :pvars)

(define-persistent-global-var -foo- #p"/tmp/foo" 0
  "This is a persistent variable with a default value of 0.")

(defun main ()
  ;; now you can use -foo- as usual, and it persists over image restarts!
  (when (< -foo- 3)
    (incf -foo-))
  (format t "~a~%" -foo-))

(save-lisp-and-die #p"foo" :toplevel #'main :executable t)
$ ./foo
1
$ ./foo
2
$ ./foo
3
$ rm -f /tmp/foo
$ ./foo
1

pvars exposes 4 macros:

Those have the same semantics are defined in global-vars. As persistent variables, those do not make sense as special variables (i.e. dynamically scoped), so they are instead "global variables", as implemented by global-vars.

The variables are serialized with CL-STORE.

Note: those variables should not be used instead of a database. The variables are serialized to disk on each write, and as such may not be best suited to your usage. Typically good usages are settings or relatively bounded databases. YMMV.

License

MIT


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 pvars

Author

Florian Margaine <florian@margaine.com>

License

MIT

Dependencies
Source

pvars.asd (file)

Components

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 pvars.asd

Location

pvars.asd

Systems

pvars (system)


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

3.1.2 pvars/package.lisp

Parent

pvars (system)

Location

package.lisp

Packages

pvars


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

3.1.3 pvars/pvars.lisp

Parent

pvars (system)

Location

pvars.lisp

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 pvars

Source

package.lisp (file)

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


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

5.1.1 Macros

Macro: define-persistent-global-parameter NAME PATH VAL &optional DOC
Package

pvars

Source

pvars.lisp (file)

Macro: define-persistent-global-parameter* NAME PATH VAL &optional DOC
Package

pvars

Source

pvars.lisp (file)

Macro: define-persistent-global-var NAME PATH VAL &optional DOC
Package

pvars

Source

pvars.lisp (file)

Macro: define-persistent-global-var* NAME PATH VAL &optional DOC
Package

pvars

Source

pvars.lisp (file)


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

5.2 Internal definitions


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

5.2.1 Special variables

Special Variable: *pvars*
Package

pvars

Source

pvars.lisp (file)


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

5.2.2 Functions

Function: access PVAR
Function: (setf access) VALUE PVAR
Package

pvars

Source

pvars.lisp (file)

Function: defp TYPE NAME PATH VAL DOC
Package

pvars

Source

pvars.lisp (file)


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

5.2.3 Generic functions

Generic Function: default OBJECT
Package

pvars

Methods
Method: default (PVAR pvar)

automatically generated reader method

Source

pvars.lisp (file)

Generic Function: last-access-write-p OBJECT
Generic Function: (setf last-access-write-p) NEW-VALUE OBJECT
Package

pvars

Methods
Method: last-access-write-p (PVAR pvar)
Method: (setf last-access-write-p) NEW-VALUE (PVAR pvar)

Used to be able to speed up reads.

Source

pvars.lisp (file)

Generic Function: last-value OBJECT
Generic Function: (setf last-value) NEW-VALUE OBJECT
Package

pvars

Methods
Method: last-value (PVAR pvar)

automatically generated reader method

Source

pvars.lisp (file)

Method: (setf last-value) NEW-VALUE (PVAR pvar)

automatically generated writer method

Source

pvars.lisp (file)

Generic Function: path OBJECT
Package

pvars

Methods
Method: path (PVAR pvar)

automatically generated reader method

Source

pvars.lisp (file)

Generic Function: written-p OBJECT
Generic Function: (setf written-p) NEW-VALUE OBJECT
Package

pvars

Methods
Method: written-p (PVAR pvar)
Method: (setf written-p) NEW-VALUE (PVAR pvar)

Used to know if we should return the default value.

Source

pvars.lisp (file)


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

5.2.4 Classes

Class: pvar ()
Package

pvars

Source

pvars.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: path
Type

pathname

Initargs

:path

Readers

path (generic function)

Slot: default
Initargs

:default

Readers

default (generic function)

Slot: written-p

Used to know if we should return the default value.

Readers

written-p (generic function)

Writers

(setf written-p) (generic function)

Slot: last-access-write-p

Used to be able to speed up reads.

Readers

last-access-write-p (generic function)

Writers

(setf last-access-write-p) (generic function)

Slot: last-value
Readers

last-value (generic function)

Writers

(setf last-value) (generic function)


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, pvars.asd: The pvars․asd file
File, Lisp, pvars/package.lisp: The pvars/package․lisp file
File, Lisp, pvars/pvars.lisp: The pvars/pvars․lisp file

L
Lisp File, pvars.asd: The pvars․asd file
Lisp File, pvars/package.lisp: The pvars/package․lisp file
Lisp File, pvars/pvars.lisp: The pvars/pvars․lisp file

P
pvars.asd: The pvars․asd file
pvars/package.lisp: The pvars/package․lisp file
pvars/pvars.lisp: The pvars/pvars․lisp file

Jump to:   F   L   P  

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

A.2 Functions

Jump to:   (  
A   D   F   G   L   M   P   W  
Index Entry  Section

(
(setf access): Internal functions
(setf last-access-write-p): Internal generic functions
(setf last-access-write-p): Internal generic functions
(setf last-value): Internal generic functions
(setf last-value): Internal generic functions
(setf written-p): Internal generic functions
(setf written-p): Internal generic functions

A
access: Internal functions

D
default: Internal generic functions
default: Internal generic functions
define-persistent-global-parameter: Exported macros
define-persistent-global-parameter*: Exported macros
define-persistent-global-var: Exported macros
define-persistent-global-var*: Exported macros
defp: Internal functions

F
Function, (setf access): Internal functions
Function, access: Internal functions
Function, defp: Internal functions

G
Generic Function, (setf last-access-write-p): Internal generic functions
Generic Function, (setf last-value): Internal generic functions
Generic Function, (setf written-p): Internal generic functions
Generic Function, default: Internal generic functions
Generic Function, last-access-write-p: Internal generic functions
Generic Function, last-value: Internal generic functions
Generic Function, path: Internal generic functions
Generic Function, written-p: Internal generic functions

L
last-access-write-p: Internal generic functions
last-access-write-p: Internal generic functions
last-value: Internal generic functions
last-value: Internal generic functions

M
Macro, define-persistent-global-parameter: Exported macros
Macro, define-persistent-global-parameter*: Exported macros
Macro, define-persistent-global-var: Exported macros
Macro, define-persistent-global-var*: Exported macros
Method, (setf last-access-write-p): Internal generic functions
Method, (setf last-value): Internal generic functions
Method, (setf written-p): Internal generic functions
Method, default: Internal generic functions
Method, last-access-write-p: Internal generic functions
Method, last-value: Internal generic functions
Method, path: Internal generic functions
Method, written-p: Internal generic functions

P
path: Internal generic functions
path: Internal generic functions

W
written-p: Internal generic functions
written-p: Internal generic functions

Jump to:   (  
A   D   F   G   L   M   P   W  

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

A.3 Variables

Jump to:   *  
D   L   P   S   W  
Index Entry  Section

*
*pvars*: Internal special variables

D
default: Internal classes

L
last-access-write-p: Internal classes
last-value: Internal classes

P
path: Internal classes

S
Slot, default: Internal classes
Slot, last-access-write-p: Internal classes
Slot, last-value: Internal classes
Slot, path: Internal classes
Slot, written-p: Internal classes
Special Variable, *pvars*: Internal special variables

W
written-p: Internal classes

Jump to:   *  
D   L   P   S   W  

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

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
Class, pvar: Internal classes

P
Package, pvars: The pvars package
pvar: Internal classes
pvars: The pvars system
pvars: The pvars package

S
System, pvars: The pvars system

Jump to:   C   P   S