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

Contents of /cl-store/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Sat Jun 5 11:56:42 2004 UTC (9 years, 10 months ago) by sross
Branch: MAIN
Changes since 1.2: +4 -1 lines
Added Readme notice for older cmucl versions and class storing.
Shadow imports from pcl for cmucl
1 sross 1.1 Readme for Package CL-STORE.
2     Author: Sean Ross
3     Homepage: http://www.common-lisp.net/project/cl-store/
4    
5     0. About.
6     CL-STORE is an portable serialization package which
7     should give you the ability to store all common-lisp
8     data types (well not all yet) into files, streams or whatever.
9    
10    
11     1. Installation.
12     The first thing you need is a common-lisp, CL-STORE currently
13     supports SBCL, CMUCL, Lispworks and CLISP.
14    
15     Hopefully you've asdf-install to install this in which case
16     all should be fine.
17    
18     Otherwise symlink cl-store.asd to somewhere on asdf:*central-registry*
19     and run (asdf:oos 'asdf:load-op :cl-store).
20    
21     Run (asdf:oos 'asdf:test-op :cl-store) to make sure that
22     everything works. Running these tests will try to
23     load the RT package, which is asdf-installable.
24     If anything breaks drop me a line, see
25     http://www.common-lisp.net/project/cl-store/ for mailing-lists.
26    
27    
28     2. Usage
29     The two main entry points are
30     - cl-store:store obj place => obj
31     Where place is a path designator, stream or socket.
32    
33     - cl-store:restore place => restored-obj
34     Where place is as above.
35    
36     - cl-store:restore is setfable, which I think makes
37     for a great serialized hit counter.
38     eg. (incf (restore place))
39    
40    
41     3. Extending
42     CL-STORE is more or less extensible. Using defstore and defrestore
43     allows you to customize the storing and restoring of your own classes.
44 sross 1.2 contrived eg.
45    
46     (defclass random () ((a :accessor a :initarg :a)))
47    
48     (defstore (obj random buffer)
49     (store-object (a obj) buffer))
50    
51     (defrestore (random buff)
52     (random (restore-object buff)))
53    
54     (store (make-instance 'random :a 10) "/tmp/random")
55    
56     (restore "/tmp/random")
57     => ; some number from 0 to 9
58    
59 sross 1.1
60     4. Issues
61 sross 1.3 There are a number of issues with CL-STORE as it stands (0.1.3).
62 sross 1.1
63     - Functions, closures and anything remotely funcallable is unserializable.
64     - MOP classes are largely unsupported at the moment.
65     - Structure instances are not supported in anything but CMUCL and SBCL.
66     - Structure definitions aren't supported at all.
67     - The code for resolving object circularities is a touch dodgy,
68     hopefully a better way will be found at some point.
69     - No documentation.
70 sross 1.2 - CL-STORE uses read-sequence to pull values out of streams. Unfortunately
71 sross 1.1 read-sequence doesn't just block but waits until the entire
72     buffer is filled. As a quick workaround the evil variable *full-write*
73     was created to force write-sequence to write the entire buffer
74     down the stream. Setting this to nil is a good idea if you are
75     working with file streams. If you are working with streams
76     created from sockets DO NOT set *full-write* to nil as this
77     will invariably hang. This has been resolved for SBCL and
78     you can store and restore objects directly to and from sockets.
79 sross 1.3 - Older cmucl versions, where (eq 'cl:class 'pcl::class)
80     returns nil, cannot store classes obtained using cl:find-class.
81     The solution for this is to use pcl::find-class.
82 sross 1.1
83    
84     Enjoy
85     Sean.
86    
87    

  ViewVC Help
Powered by ViewVC 1.1.5