Skip to content

Commit

Permalink
be able to store lists
Browse files Browse the repository at this point in the history
  • Loading branch information
vii committed Feb 25, 2010
1 parent 4327478 commit 33c6c62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/datastore/datastore.lisp
Expand Up @@ -17,7 +17,7 @@
(defun datastore-use-file (filename)
(unless (datastore-open-p)
(datastore-load filename)
(setf *datastore* (open filename :direction :output :if-exists :append :if-does-not-exist :create))))
(setf *datastore* (open filename :direction :output :if-exists :append :if-does-not-exist :create #+ccl :sharing #+ccl :lock))))

(defun datastore-ref-form (object)
`(datastore-retrieve-unique ',(class-name (class-of object)) 'datastore-id ,(slot-value object 'datastore-id)))
Expand Down Expand Up @@ -80,7 +80,6 @@
string)
(defmethod datastore-save-form ((number number))
number)

(defmethod datastore-save-form ((array array))
(typecase array
(byte-vector
Expand All @@ -89,6 +88,9 @@
`(make-array ',(array-dimensions array)
:element-type ',(array-element-type array)
:initial-contents (list ,@(map 'list 'datastore-save-form array))))))
(defmethod datastore-save-form ((list list))
(when list
`(list ,@(map 'list 'datastore-save-form list))))

(defgeneric datastore-record-constructor-form (object))

Expand Down

0 comments on commit 33c6c62

Please sign in to comment.