[cl-prevalence-cvs] CVS update: cl-prevalence/src/prevalence.lisp cl-prevalence/src/serialization.lisp
Sven Van Caekenberghe
scaekenberghe at common-lisp.net
Tue Jun 22 08:37:23 UTC 2004
Update of /project/cl-prevalence/cvsroot/cl-prevalence/src
In directory common-lisp.net:/tmp/cvs-serv14563/src
Modified Files:
prevalence.lisp serialization.lisp
Log Message:
more work on integrating sexp serialization
added benchmark2
Date: Tue Jun 22 01:37:23 2004
Author: scaekenberghe
Index: cl-prevalence/src/prevalence.lisp
diff -u cl-prevalence/src/prevalence.lisp:1.2 cl-prevalence/src/prevalence.lisp:1.3
--- cl-prevalence/src/prevalence.lisp:1.2 Mon Jun 21 08:26:21 2004
+++ cl-prevalence/src/prevalence.lisp Tue Jun 22 01:37:23 2004
@@ -1,6 +1,6 @@
;;;; -*- mode: Lisp -*-
;;;;
-;;;; $Id: prevalence.lisp,v 1.2 2004/06/21 15:26:21 scaekenberghe Exp $
+;;;; $Id: prevalence.lisp,v 1.3 2004/06/22 08:37:23 scaekenberghe Exp $
;;;;
;;;; Object Prevalence in Common Lisp
;;;;
@@ -14,12 +14,12 @@
;;; Public API: Functions and Generic Functions
-(defun make-prevalence-system (directory &key (prevalence-system-class 'prevalence-system))
+(defun make-prevalence-system (directory &key (prevalence-system-class 'prevalence-system) init-args)
"Create and return a new prevalence system on directory. When the
directory contains a valid snapshot and/or transaction log file, the
system will be restored. Optionally specify the prevalence system's
class."
- (make-instance prevalence-system-class :directory directory))
+ (apply #'make-instance prevalence-system-class :directory directory init-args))
(defun make-transaction (function &rest args)
"Create and return a new transaction specifying a function name and
@@ -87,12 +87,15 @@
:initform nil)
(serializer ;; type function
:accessor get-serializer
+ :initarg :serializer
:initform #'serialize-xml)
(deserializer ;; type function
:accessor get-deserializer
+ :initarg :deserializer
:initform #'deserialize-xml)
(file-extension ;; type string
:accessor get-file-extension
+ :initarg :file-extension
:initform "xml"))
(:documentation "Base Prevalence system implementation object"))
Index: cl-prevalence/src/serialization.lisp
diff -u cl-prevalence/src/serialization.lisp:1.1.1.1 cl-prevalence/src/serialization.lisp:1.2
--- cl-prevalence/src/serialization.lisp:1.1.1.1 Sun Jun 20 12:13:41 2004
+++ cl-prevalence/src/serialization.lisp Tue Jun 22 01:37:23 2004
@@ -1,6 +1,6 @@
;;;; -*- mode: Lisp -*-
;;;;
-;;;; $Id: serialization.lisp,v 1.1.1.1 2004/06/20 19:13:41 scaekenberghe Exp $
+;;;; $Id: serialization.lisp,v 1.2 2004/06/22 08:37:23 scaekenberghe Exp $
;;;;
;;;; XML and S-Expression based Serialization for Common Lisp and CLOS
;;;;
@@ -45,8 +45,8 @@
(reset serialization-state)
(let ((sexp (read stream nil :eof)))
(if (eq sexp :eof)
- (error "Unexpected end of file while deserializing from s-expression"))
- (deserialize-sexp-internal sexp (get-hashtable serialization-state))))
+ nil
+ (deserialize-sexp-internal sexp (get-hashtable serialization-state)))))
(defun make-serialization-state ()
"Create a reusable serialization state to pass as optional argument to [de]serialize-xml"
@@ -102,6 +102,7 @@
((eq package +keyword-package+) (write-char #\: stream))
(t (write-string (package-name package) stream)
(write-string "::" stream)))
+ ;; this is *NOT* correct for unprintable symbols !!
(write-string name stream)))
(defmethod serializable-slots ((object structure-object))
More information about the Cl-prevalence-cvs
mailing list