From sross at common-lisp.net Thu Dec 2 10:31:59 2004 From: sross at common-lisp.net (Sean Ross) Date: Thu, 2 Dec 2004 11:31:59 +0100 (CET) Subject: [cl-store-cvs] CVS update: cl-store/cl-store-xml.noasd cl-store/.cvsignore cl-store/ChangeLog cl-store/README cl-store/cl-store.asd cl-store/default-backend.lisp cl-store/xml-backend.lisp cl-store/cl-store-xml.asd Message-ID: <20041202103159.81D90880E7@common-lisp.net> Update of /project/cl-store/cvsroot/cl-store In directory common-lisp.net:/tmp/cvs-serv31538 Modified Files: .cvsignore ChangeLog README cl-store.asd default-backend.lisp xml-backend.lisp Added Files: cl-store-xml.noasd Removed Files: cl-store-xml.asd Log Message: Changelog 2004-12-02 Date: Thu Dec 2 11:31:55 2004 Author: sross Index: cl-store/.cvsignore diff -u cl-store/.cvsignore:1.2 cl-store/.cvsignore:1.3 --- cl-store/.cvsignore:1.2 Tue Aug 17 13:12:43 2004 +++ cl-store/.cvsignore Thu Dec 2 11:31:54 2004 @@ -4,3 +4,5 @@ filetest.cls *.fas *.lib +clean.sh +wc.sh Index: cl-store/ChangeLog diff -u cl-store/ChangeLog:1.16 cl-store/ChangeLog:1.17 --- cl-store/ChangeLog:1.16 Fri Nov 26 15:33:38 2004 +++ cl-store/ChangeLog Thu Dec 2 11:31:54 2004 @@ -1,3 +1,9 @@ +2004-12-02 Sean Ross + * sbcl/custom.lisp, cmucl/custom.lisp: Changed the evals when restoring + structure definitions to (funcall (compile nil ...)) + * cl-store-xml.asd: Removed + * cl-store-xml.noasd: Added (xml-backend is officially nuked). + 2004-11-26 Sean Ross * cmucl/custom.lisp: Custom structure definition storing for CMUCL. * plumbing.lisp: Bind *read-eval* to nil inside store and restore. Index: cl-store/README diff -u cl-store/README:1.13 cl-store/README:1.14 --- cl-store/README:1.13 Fri Nov 26 15:35:36 2004 +++ cl-store/README Thu Dec 2 11:31:54 2004 @@ -1,13 +1,15 @@ README for Package CL-STORE. Author: Sean Ross Homepage: http://www.common-lisp.net/project/cl-store/ -Version: 0.4.1 +Version: 0.4.2 0. About. CL-STORE is an portable serialization package which should give you the ability to store all common-lisp data types (well not all yet) into streams. See the cl-store manual (docs/cl-store.texi) for more in depth information. + + !!! NOTE: The cl-store-xml backend is deprecated. 1. Usage The main entry points are Index: cl-store/cl-store.asd diff -u cl-store/cl-store.asd:1.15 cl-store/cl-store.asd:1.16 --- cl-store/cl-store.asd:1.15 Fri Nov 26 15:35:36 2004 +++ cl-store/cl-store.asd Thu Dec 2 11:31:54 2004 @@ -40,7 +40,7 @@ :name "CL-STORE" :author "Sean Ross " :maintainer "Sean Ross " - :version "0.4.1" + :version "0.4.2" :description "Serialization package" :long-description "Portable CL Package to serialize data types" :licence "MIT" Index: cl-store/default-backend.lisp diff -u cl-store/default-backend.lisp:1.14 cl-store/default-backend.lisp:1.15 --- cl-store/default-backend.lisp:1.14 Fri Nov 26 15:35:36 2004 +++ cl-store/default-backend.lisp Thu Dec 2 11:31:54 2004 @@ -59,7 +59,7 @@ (defconstant +function-code+ (register-code 26 'function nil)) (defconstant +gf-code+ (register-code 27 'generic-function nil)) -;; Used by SBCL. +;; Used by SBCL and CMUCL. (defconstant +structure-class-code+ (register-code 28 'structure-class nil)) (defconstant +struct-def-code+ (register-code 29 'struct-def nil)) Index: cl-store/xml-backend.lisp diff -u cl-store/xml-backend.lisp:1.8 cl-store/xml-backend.lisp:1.9 --- cl-store/xml-backend.lisp:1.8 Fri Nov 26 15:35:36 2004 +++ cl-store/xml-backend.lisp Thu Dec 2 11:31:54 2004 @@ -1,6 +1,9 @@ ;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;; See the file LICENCE for licence information. +;; THIS BACKEND IS DEPRECATED AND WILL NOT WORK +;; ITS PRESENCE IS FOR POSTERITY ONLY + (in-package :cl-store-xml) (declaim (optimize (speed 3) (safety 1) (debug 0))) @@ -92,6 +95,7 @@ (defmethod backend-restore ((place stream) (backend xml-backend)) (let ((*restore-counter* 0) (*need-to-fix* nil) + (*print-circle* nil) (*restored-values* (make-hash-table))) (multiple-value-prog1 (backend-restore-object (or (xmls:parse place) @@ -120,13 +124,11 @@ (with-tag ("SIMPLE-STRING" place) (format place "~S" string))) -(defstore-xml (obj string stream) - (if (typep obj 'simple-standard-string) - (xml-dump-simple-string obj stream) - (xml-dump-array obj stream))) +(defstore-xml (obj simple-string stream) + (xml-dump-simple-string obj stream)) (defrestore-xml (simple-string place) - (read-from-string (third place))) + (remove #\" (third place))) ;; float @@ -179,13 +181,16 @@ ;; symbol (defstore-xml (obj symbol stream) - (format stream "~A::~A" - (package-name (symbol-package obj)) - (symbol-name obj))) + (with-tag ("SYMBOL" stream) + (princ-xml "NAME" (symbol-name obj) stream) + (princ-and-store "PACKAGE" (symbol-package obj) stream))) +(store 'foo "/home/sdr/test.out") +(restore "/home/sdr/test.out") (defrestore-xml (symbol place) - (read-from-string (first-child place))) - + (intern (restore-first (get-child "NAME" place)) + (or (restore-first (get-child "PACKAGE" place)) + *package*))) ;; cons (defstore-xml (obj cons stream) @@ -468,4 +473,4 @@ (setf *default-backend* *xml-backend*) -;; EOF \ No newline at end of file +;; EOF From sross at common-lisp.net Thu Dec 2 10:32:02 2004 From: sross at common-lisp.net (Sean Ross) Date: Thu, 2 Dec 2004 11:32:02 +0100 (CET) Subject: [cl-store-cvs] CVS update: cl-store/cmucl/custom.lisp Message-ID: <20041202103202.B2C3F884FC@common-lisp.net> Update of /project/cl-store/cvsroot/cl-store/cmucl In directory common-lisp.net:/tmp/cvs-serv31538/cmucl Modified Files: custom.lisp Log Message: Changelog 2004-12-02 Date: Thu Dec 2 11:31:59 2004 Author: sross Index: cl-store/cmucl/custom.lisp diff -u cl-store/cmucl/custom.lisp:1.4 cl-store/cmucl/custom.lisp:1.5 --- cl-store/cmucl/custom.lisp:1.4 Fri Nov 26 15:35:51 2004 +++ cl-store/cmucl/custom.lisp Thu Dec 2 11:31:59 2004 @@ -95,9 +95,9 @@ (kernel::define-class-methods dd))) (defun create-make-foo (dd) - (dolist (x (cmu-struct-defs dd)) - (eval x)) - (find-class (dd-name dd))) + (let ((*compile-print* nil)) + (funcall (compile nil `(lambda () ,@(cmu-struct-defs dd)))) + (find-class (dd-name dd)))) (defun cmu-define-structure (dd supers) (cond ((or *nuke-existing-classes* From sross at common-lisp.net Thu Dec 2 10:32:05 2004 From: sross at common-lisp.net (Sean Ross) Date: Thu, 2 Dec 2004 11:32:05 +0100 (CET) Subject: [cl-store-cvs] CVS update: cl-store/doc/cl-store.texi Message-ID: <20041202103205.221B4880E7@common-lisp.net> Update of /project/cl-store/cvsroot/cl-store/doc In directory common-lisp.net:/tmp/cvs-serv31538/doc Modified Files: cl-store.texi Log Message: Changelog 2004-12-02 Date: Thu Dec 2 11:32:03 2004 Author: sross Index: cl-store/doc/cl-store.texi diff -u cl-store/doc/cl-store.texi:1.4 cl-store/doc/cl-store.texi:1.5 --- cl-store/doc/cl-store.texi:1.4 Fri Nov 26 15:35:54 2004 +++ cl-store/doc/cl-store.texi Thu Dec 2 11:32:02 2004 @@ -148,8 +148,8 @@ The latest cl-store release will always be available from @uref{http://www.common-lisp.net,,cl.net}. Download and untar in an appropriate directory then symlink @file{cl-store.asd} -and @file{cl-store-xml.asd} to a directory on @code{asdf:*central-registry*} (see -the documentation for asdf for details about setting up asdf). +to a directory on @code{asdf:*central-registry*} +(see the documentation for asdf for details about setting up asdf). @item CVS @@ -549,7 +549,9 @@ You can define your own backends in cl-store to do custom object I/O. Theoretically one can add a backend that can do socket based communication with any language provided you know the -correct format to output objects in. +correct format to output objects in. If the framework is not +sufficient to add your own backend just drop me a line and +we will see what we can do about it. @section The Process @@ -576,7 +578,6 @@ When storing an object the type code is written down the stream first and then the restoring details for that particular object. The @code{get-next-reader} method is then specialized to read the type code and look up the symbol in a hash-table kept on the backend. -The xml backend outputs no type codes but looks up the symbol by looking at the objects opening tag. eg. (from the cl-store-backend) @lisp @@ -740,7 +741,7 @@ @section Known Issues @itemize @bullet @item CLISP, OpenMCL, Allegro CL cannot store structure instances. - at item Structure definitions are only supported in SBCL. + at item Structure definitions are only supported in SBCL and CMUCL. @item MOP classes aren't supported. @item Due to the fact that function's aren't fully supported CLOS Classes initfunction slot cannot be serialized. @end itemize From sross at common-lisp.net Thu Dec 2 10:32:18 2004 From: sross at common-lisp.net (Sean Ross) Date: Thu, 2 Dec 2004 11:32:18 +0100 (CET) Subject: [cl-store-cvs] CVS update: cl-store/sbcl/custom.lisp Message-ID: <20041202103218.4B9A2880E7@common-lisp.net> Update of /project/cl-store/cvsroot/cl-store/sbcl In directory common-lisp.net:/tmp/cvs-serv31538/sbcl Modified Files: custom.lisp Log Message: Changelog 2004-12-02 Date: Thu Dec 2 11:32:15 2004 Author: sross Index: cl-store/sbcl/custom.lisp diff -u cl-store/sbcl/custom.lisp:1.4 cl-store/sbcl/custom.lisp:1.5 --- cl-store/sbcl/custom.lisp:1.4 Wed Nov 24 14:27:22 2004 +++ cl-store/sbcl/custom.lisp Thu Dec 2 11:32:04 2004 @@ -91,16 +91,13 @@ (store-object (sdef-info obj) stream)) ;; Restoring - (defun sbcl-struct-defs (info) (append (sb-kernel::constructor-definitions info) (sb-kernel::class-method-definitions info))) (defun create-make-foo (dd) - (dolist (x (sbcl-struct-defs dd)) - (eval x)) + (funcall (compile nil `(lambda () ,@(sbcl-struct-defs dd)))) (find-class (dd-name dd))) - (defun sbcl-define-structure (dd supers) (cond ((or *nuke-existing-classes*