/[cl-store]/cl-store/README
ViewVC logotype

Diff of /cl-store/README

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by sross, Wed Oct 13 12:35:57 2004 UTC revision 1.10 by sross, Mon Nov 1 14:30:18 2004 UTC
# Line 1  Line 1 
1  README for Package CL-STORE.  README for Package CL-STORE.
2  Author: Sean Ross  Author: Sean Ross
3  Homepage: http://www.common-lisp.net/project/cl-store/  Homepage: http://www.common-lisp.net/project/cl-store/
4  Version: 0.3  Version: 0.3.2
5    
6  0. About.  0. About.
7     CL-STORE is an portable serialization package which     CL-STORE is an portable serialization package which
8     should give you the ability to store all common-lisp     should give you the ability to store all common-lisp
9     data types (well not all yet) into streams.     data types (well not all yet) into streams.
10       See the cl-store manual (docs/cl-store.texi) for more in depth information.
11    
12    1. Usage
 1. Installation.  
    The first thing you need is a common-lisp, CL-STORE currently  
    supports SBCL, CMUCL, Lispworks, CLISP and OpenMCL.  
   
    Hopefully you've asdf-install to install this in which case  
    all should be fine.  
   
    Otherwise symlink cl-store.asd to somewhere on asdf:*central-registry*  
    and run (asdf:oos 'asdf:load-op :cl-store).  
   
    The xml backend can be loaded with (asdf:oos 'asdf:loaded :cl-store-xml).  
    This requires xmls which can be found on http://www.cliki.net and  
    is asdf-installable.  
   
    Run (asdf:oos 'asdf:test-op :cl-store) and (asdf:oos 'asdf:test-op :cl-store-xml)  
    to make sure that everything works. Running these tests will try to  
    load the RT package, which is asdf-installable.  
    If anything breaks drop me a line, see  
    http://www.common-lisp.net/project/cl-store/ for mailing-lists.  
   
   
 2. Usage  
13     The main entry points are     The main entry points are
14      - [Function] cl-store:store (obj place &optional (backend *default-backend*)) i      - [Function] cl-store:store (obj place &optional (backend *default-backend*)) i
15            => obj            => obj
# Line 48  Version: 0.3 Line 27  Version: 0.3
27      - cl-store:restore is setfable, which I think makes      - cl-store:restore is setfable, which I think makes
28        for a great serialized hit counter.        for a great serialized hit counter.
29        eg. (incf (restore place))        eg. (incf (restore place))
   
30    
31      NOTE.      NOTE.
32       All errors signalled within store and restore can       All errors signalled within store and restore can
33       be handled by catching store-error and restore-error respectively.       be handled by catching store-error and restore-error respectively.
34    
   
 3. Extending  
    CL-STORE is more or less extensible. Using defstore-<backend-name>  
    and defrestore-<backend-name> allows you to customize the storing  
    and restoring of  your own classes.  
   
    contrived eg.  
   
     (in-package :cl-user)  
   
     (use-package :cl-store)  
   
     (setf *default-backend* *cl-store-backend*)  
   
     (defclass random-obj () ((a :accessor a :initarg :a)))  
   
     (defvar *random-obj-code* (register-code 110 'random-obj))  
   
     (defstore-cl-store (obj random-obj stream)  
       (output-type-code *random-obj-code* stream)  
       (store-object (a obj) stream))  
   
     (defrestore-cl-store (random-obj stream)  
       (random (restore-object stream)))  
   
     (store (make-instance 'random-obj :a 10) "/tmp/random")  
   
     (restore "/tmp/random")  
     => ; some number from 0 to 9  
   
   
 4. Backends  
    CL-STORE now has a concept of backends, suggested by Robert Sedgewick.  
    Two backends are in releases now, a default backend which is much  
    what cl-store used to be (pre 0.2) and an xml backend which writes out  
    xml to character streams.  
   
    Store and Restore now take an optional backend argument which  
    currently can be one of *default-backend*, *xml-backend* or  
    a self defined backend.  
   
    The xml written out is not very human readable.  
    I recommend using a tool like tidy <http://tidy.sourceforge.net/>  
    to view it in a nice format.  
   
   
 5. Issues  
    There are a number of issues with CL-STORE as it stands.  
   
    - Functions, closures and anything remotely funcallable is unserializable.  
    - MOP classes are largely unsupported at the moment.  
    - Structure instances are not supported in MCL, OpenMCL and Clisp.  
    - Structure definitions aren't supported at all.  
    - No documentation.  
    - Older cmucl versions, where (eq 'cl:class 'pcl::class)  
      returns nil, cannot store classes obtained using cl:find-class.  
      The solution for this is to use pcl::find-class.  
   
   
35  Enjoy  Enjoy
36   Sean.   Sean.

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.5