Hide
Login/Register to vote and to have access to more featuresYou are here: Root > By Topic > Database
View the dependency graph for this librarySAVE-OBJECT
Created by brandonz on: Wed, 22 Feb 2006 22:36:36 GMT, Last modification: Wed, 22 Feb 2006 22:45:38 GMT
SAVE-OBJECT is a recursive function which writes an ASCII representation
of a LISP object to a designated file.
Description
SAVE-OBJECT is a recursive function which writes an ASCII representation
of a LISP object to a designated file.
kr010622: in other words, it serializes arbitrary LISP data
structures, very similar to what the "pickle" operation does in the
scripting language python.
NOTE: SAVE-OBJECT doesnt need a special LOAD function!
You can load files created by SAVE-OBJECT with the
standard LOAD function
Usage
To save:
(SAVE-OBJECT (list 10 20 30) "myfile.lisp") ,
To restore the data in the saved list:
(LOAD "myfile.lisp")
Where the newly restored data ends up:
db:*db-input* == (LIST 10 20 30)
Objects which may be saved include:
- symbols, keywords, characters, strings, and pathnames.
- numbers, including integer, rational, complex, and floating point.
- vectors and multi-dimensional arrays.
- objects produced by DEFSTRUCT.
- CLOS (PCL) instances, and CLOS(PCL) classes.
- hash tables.
- compiled functions, represented as (FUNCTION ),
internally.
- generic functions, method objects, and class objects.
- conses and lists.
- circular conses and lists (new)
- user defined methods may be defined for arbitrary objects, such
as images.
- readtables (a kludge for now)
- CLIM objects (saved as ordinary CLOS instances)
Compatible Implementations
CMUCL | SBCL
Tags
Database | Public Domain | Object-Oriented
0 Notes and 0 comments
0 Notes
You must be logged to add a note
0 Comments
You must be logged to add a comment