I'd like to displace an (unsigned-byte 8) array to an (unsigned-byte 32) 
array.
But that doesn't seem to be supported (see below). Is there any way to 
do this? 

- Bob


----------------------------------

 > (setq aa (make-array 100 :element-type '(unsigned-byte 32)))
 > (setq bb (make-array 100 :displaced-to aa :element-type 
'(unsigned-byte 8)))

;; It ignores the supplied element-type

 > (describe bb)
#(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...) is a displaced vector of 
length 100.
It has no fill pointer.
Its element type is specialized to (UNSIGNED-BYTE 32).

-------------------------------------

;; Mapping in the other direction gets an error:

 > (setq cc (make-array 100 :element-type '(unsigned-byte 8)))
#(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...)
 > (setq dd (make-array 10 :displaced-to cc :element-type 
'(unsigned-byte 32)))

Error in function MAKE-ARRAY:
   One can't displace an array of type (UNSIGNED-BYTE
                                        32) into another of type 
(UNSIGNED-BYTE
                                                                  8).
   [Condition of type SIMPLE-ERROR]




Reply via email to