From: Thomas F. B. <tf...@oc...> - 2006-01-24 16:06:39
|
On 1/22/06, Stelian Ionescu <ste...@po...> wrote: > I'm running sbcl 0.9.8.47 on GNU/Linux and when compiling this function: > > (defun compact4->netaddr (string &key (start 0)) > (let ((addr (make-array 4 :element-type '(unsigned-byte 8))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This creates a (simple-array (unsigned-byte 8) (4)), which is not a simple-vector. > I get this warning(among others): > > ; note: deleting unreachable code > > ; (SETF (SVREF CL-TORRENT-MAIN::ADDR CL-TORRENT-MAIN::I) > ; (CHAR-CODE (SCHAR STRING CL-TORRENT-MAIN::OFF))) > ; --> SB-KERNEL:%SVSET SB-KERNEL:%ASET > ; =3D=3D> > ; (THE SIMPLE-VECTOR CL-TORRENT-MAIN::ADDR) > ; > ; caught WARNING: > ; Asserted type SIMPLE-VECTOR conflicts with derived type > ; (VALUES (SIMPLE-ARRAY (UNSIGNED-BYTE 8) (4)) &OPTIONAL). Which is correct. > yet (typep #(make-array 4 :element-type '(unsigned-byte 8)) 'simple-vecto= r) > returns T (correctly) Indeed, that is correct, but I don't think it's checking what you think it is. #() is the syntax for a literal simple-vector. If you remove the # you'll get the test you were trying to perform (which returns NIL). |