[elephant-cvs] CVS update: elephant/src/serializer.lisp

blee at common-lisp.net blee at common-lisp.net
Sat Sep 4 08:59:42 UTC 2004


Update of /project/elephant/cvsroot/elephant/src
In directory common-lisp.net:/tmp/cvs-serv22085/src

Modified Files:
	serializer.lisp 
Log Message:
really fixed the array types (hopefully!)

Date: Sat Sep  4 10:59:40 2004
Author: blee

Index: elephant/src/serializer.lisp
diff -u elephant/src/serializer.lisp:1.7 elephant/src/serializer.lisp:1.8
--- elephant/src/serializer.lisp:1.7	Sat Sep  4 10:20:37 2004
+++ elephant/src/serializer.lisp	Sat Sep  4 10:59:40 2004
@@ -355,19 +355,23 @@
 (setf (gethash '(complex double-float) array-type-to-byte) #x06)
 (setf (gethash 'fixnum array-type-to-byte) #x07)
 (setf (gethash 'bit array-type-to-byte) #x08)
+
+(defun type= (t1 t2)
+  (and (subtypep t1 t2) (subtypep t2 t1)))
+
 (let ((counter 8))
   (loop for i from 2 to 65
 	for spec = (list 'unsigned-byte i)
 	for uspec = (upgraded-array-element-type spec)
-	unless (gethash uspec array-type-to-byte)
+	when (type= spec uspec)
 	do
-	(setf (gethash uspec array-type-to-byte) (incf counter)))
+	(setf (gethash spec array-type-to-byte) (incf counter)))
   (loop for i from 2 to 65
 	for spec = (list 'signed-byte i)
 	for uspec = (upgraded-array-element-type spec)
-	unless (gethash uspec array-type-to-byte)
+	when (type= spec uspec)
 	do
-	(setf (gethash uspec array-type-to-byte) (incf counter))))
+	(setf (gethash spec array-type-to-byte) (incf counter))))
 
 (loop for key being the hash-key of array-type-to-byte 
       using (hash-value value)





More information about the Elephant-cvs mailing list