https://github.com/WarrenWilkinson/persistent-variables.git
git clone 'https://github.com/WarrenWilkinson/persistent-variables.git'
(ql:quickload :persistent-variables)
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))
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.
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.
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.
In summary: Untar the .tar package and then symlink the .asd files into a place where ASDF can find them.
Untar the files where you want them to be. On windows download the .zip and unzip it instead, it's the same files.
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)
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.
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
You can find support on this libraries website and/or github repository. Or you can email Warren Wilkinson.
Persister is distributed under the LGPL2 License.