[Ecls-list] Patch: don't upgrade unsigned array element types to signed

Josh Elsasser josh at elsasser.org
Sat Aug 30 20:58:10 UTC 2008


When finding an upgraded array element type, EXT::CL-FIXNUM (a signed
type) is preferred over EXT::CL-INDEX (unsigned).  This has the
possibly undesirable result of upgrading an unsigned type to a signed
one.  Reversing the ordering as follows allows both signed and
unsigned types to be upgraded as expected.

--- src/lsp/predlib.lsp
+++ src/lsp/predlib.lsp
@@ -266,7 +266,7 @@ has no fill-pointer, and is not adjustable."
   (put-sysprop (car l) 'TYPE-PREDICATE (cdr l)))
 
 (defconstant +upgraded-array-element-types+
-  '(NIL BASE-CHAR #+unicode CHARACTER BIT EXT::BYTE8 EXT::INTEGER8 EXT::CL-FIXNUM EXT::CL-INDEX SINGLE-FLOAT DOUBLE-FLOAT T))
+  '(NIL BASE-CHAR #+unicode CHARACTER BIT EXT::BYTE8 EXT::INTEGER8 EXT::CL-INDEX EXT::CL-FIXNUM SINGLE-FLOAT DOUBLE-FLOAT T))
 
 (defun upgraded-array-element-type (element-type &optional env)
   (let* ((hash (logand 127 (si:hash-eql element-type)))




More information about the ecl-devel mailing list