[cl-store-cvs] CVS update: cl-store/ChangeLog cl-store/README cl-store/cl-store.asd cl-store/default-backend.lisp cl-store/tests.lisp

Sean Ross sross at common-lisp.net
Fri Oct 1 08:49:48 UTC 2004


Update of /project/cl-store/cvsroot/cl-store
In directory common-lisp.net:/tmp/cvs-serv19698

Modified Files:
	ChangeLog README cl-store.asd default-backend.lisp tests.lisp 
Log Message:
Changelog 2004-10-01

Date: Fri Oct  1 10:49:46 2004
Author: sross

Index: cl-store/ChangeLog
diff -u cl-store/ChangeLog:1.8 cl-store/ChangeLog:1.9
--- cl-store/ChangeLog:1.8	Mon Sep 27 13:24:18 2004
+++ cl-store/ChangeLog	Fri Oct  1 10:49:46 2004
@@ -1,3 +1,7 @@
+2004-10-01 Sean Ross <sdr at jhb.ucs.co.za>
+	* lispworks/custom.lisp: Lispworks support for inifinite floats from Alain Picard.
+	* tests.lisp: Infite float tests for lispworks.
+	
 2004-09-27 Sean Ross <sdr at jhb.ucs.co.za>
 	* plumbing.lisp: Slightly nicer error handling (I think).
 	All conditions caught in store and restore are resignalled


Index: cl-store/README
diff -u cl-store/README:1.6 cl-store/README:1.7
--- cl-store/README:1.6	Mon Aug 30 17:10:20 2004
+++ cl-store/README	Fri Oct  1 10:49:46 2004
@@ -1,7 +1,7 @@
 README for Package CL-STORE.
 Author: Sean Ross 
 Homepage: http://www.common-lisp.net/project/cl-store/
-Version: 0.2
+Version: 0.2.5
 
 0. About.
    CL-STORE is an portable serialization package which 
@@ -34,8 +34,8 @@
    The two main entry points are 
     - cl-store:store (obj place &optional (backend *default-backend*)) i
           => obj
-       Where place is a path designator, stream or socket and
-       backend is one of the registered backend.
+       Where place is a path designator or stream and
+       backend is one of the registered backends.
 
     - cl-store:restore (place &optional (backend *default-backend*)) 
           => restored-obj
@@ -81,6 +81,11 @@
    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. 
+
+   NOTE: As of 0.2.5 the xml backend isn't actively being developed.
+   It's turning out to more of a pain than it's worth. It is now 
+   only there as an example.
+
    Store and Restore now take an optional backend argument which 
    currently can be one of *default-backend* or *xml-backend*. 
 
@@ -90,7 +95,7 @@
 
  
 5. Issues
-   There are a number of issues with CL-STORE as it stands (0.2).
+   There are a number of issues with CL-STORE as it stands (0.2.5).
    
    - Functions, closures and anything remotely funcallable is unserializable.
    - MOP classes are largely unsupported at the moment.


Index: cl-store/cl-store.asd
diff -u cl-store/cl-store.asd:1.8 cl-store/cl-store.asd:1.9
--- cl-store/cl-store.asd:1.8	Mon Sep 27 13:24:18 2004
+++ cl-store/cl-store.asd	Fri Oct  1 10:49:46 2004
@@ -39,7 +39,7 @@
   :name "CL-STORE"
   :author "Sean Ross <sdr at jhb.ucs.co.za>"
   :maintainer "Sean Ross <sdr at jhb.ucs.co.za>"
-  :version "0.2.3"
+  :version "0.2.5"
   :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.6 cl-store/default-backend.lisp:1.7
--- cl-store/default-backend.lisp:1.6	Mon Sep 27 13:24:18 2004
+++ cl-store/default-backend.lisp	Fri Oct  1 10:49:46 2004
@@ -46,7 +46,11 @@
 (defconstant +array-code+ (register-code 19 'array))
 (defconstant +simple-vector-code+ (register-code 20 'simple-vector))
 (defconstant +package-code+ (register-code 21 'package))
-(defconstant +function-code+ (register-code 22 'function))
+
+;; Used by lispworks
+(defconstant +positive-infinity-code+ (register-code 22 'positive-infinity))
+(defconstant +negative-infinity-code+ (register-code 23 'negative-infinity))
+  
 
 ;; setups for type code mapping
 (defun output-type-code (code stream)
@@ -148,6 +152,7 @@
 ;; Is integer-decode-float the Right Thing, or should we 
 ;; be using something like sb-kernel:single-float-bits
 ;; and sb-kernel:make-single-float
+#-lispworks
 (defstore-cl-store (obj float stream)
   (output-type-code +float-code+ stream)    
   (multiple-value-bind (significand exponent sign)
@@ -158,11 +163,10 @@
     (store-object sign stream)))
 
 (defrestore-cl-store (float stream)
-  (let ((type (get-float-type (read-byte stream)))
-        (significand (restore-object stream))
-        (exponent (restore-object stream))
-        (sign (restore-object stream)))
-    (float (* (* significand (* 1.0d0 (expt 2 exponent))) sign) type)))
+  (float (* (get-float-type (read-byte stream))
+            (* (restore-object stream)
+               (* 1.0d0 (expt 2 (restore-object stream))))
+            (restore-object stream))))
 
 ;; ratio
 (defstore-cl-store (obj ratio stream)
@@ -178,22 +182,18 @@
   (output-type-code +character-code+ stream)    
   (store-object (char-code obj) stream))
 
-
 (defrestore-cl-store (character stream)
   (code-char (restore-object stream)))
 
 ;; complex
 (defstore-cl-store (obj complex stream)
   (output-type-code +complex-code+ stream)    
-  (let ((real (realpart obj))
-        (imag (imagpart obj)))
-    (store-object real stream)
-    (store-object imag stream)))
+  (store-object (realpart obj) stream)
+  (store-object (imagpart obj) stream))
 
 (defrestore-cl-store (complex stream)
-  (let ((real (restore-object stream))
-        (imag (restore-object stream)))
-    (complex real imag)))
+  (complex (restore-object stream)
+           (restore-object stream)))
 
 ;; symbols
 (defstore-cl-store (obj symbol stream)
@@ -208,7 +208,6 @@
   (let ((package (restore-simple-standard-string stream))
         (name (restore-simple-standard-string stream)))
     (values (intern name package))))
-
 
 ;; lists
 (defstore-cl-store (obj cons stream)


Index: cl-store/tests.lisp
diff -u cl-store/tests.lisp:1.5 cl-store/tests.lisp:1.6
--- cl-store/tests.lisp:1.5	Mon Aug 30 17:10:20 2004
+++ cl-store/tests.lisp	Fri Oct  1 10:49:46 2004
@@ -61,6 +61,13 @@
 (deftestit double-float.5 most-positive-double-float)
 (deftestit double-float.6 most-negative-double-float)
 
+;; infinite floats
+#+lispworks
+(deftestit infinite-float.1 cl-store::+negative-infinity+)
+#+lispworks
+(deftestit infinite-float.2 cl-store::+positive-infinity+)
+
+
 ;; characters
 (deftestit char.1 #\Space)
 (deftestit char.2 #\f )
@@ -426,7 +433,7 @@
 
 (defclass random-obj () ((size :accessor size :initarg :size)))
 
-(defvar *random-obj-code* (register-code 22 'random-obj))
+(defvar *random-obj-code* (register-code 100 'random-obj))
 
 (defstore-cl-store (obj random-obj buff)
   (output-type-code *random-obj-code* buff)
@@ -452,9 +459,6 @@
 (defun run-tests ()
   (format t "~&RUNNING TESTS USING CL-STORE-BACKEND~%")
   (with-backend (cl-store)
-    (regression-test:do-tests))
-  (format t "~&RUNNING TESTS USING XML-BACKEND~%")
-  (with-backend (xml)
     (regression-test:do-tests))
   (when (probe-file *test-file*)
     (delete-file *test-file*)))





More information about the Cl-store-cvs mailing list