>>>>> "David" == David Hanley <[EMAIL PROTECTED]> writes:

    David> I have code very like the following in CMUCL:

    David> (deftype hash-type () '(unsigned-byte 32))


    David> (defparameter hash-code 0)
    David> (declaim (type hash-type hash-code))

    David> (defun foo( x )
    David>   (declare (type hash-type x))
    David>   (setf hash-code (logxor hash-code x)))

    David> this always gives me a warning :

    David> note: doing unsigned work to integer conversion (cost
    David> 20) for: 
    David> the second argument of SET

    David> it doesn't seem to matter if i make hash-type fixnum
    David> or not.  This whole operation is quite expensive and
    David> happens deep in an inner loop in my code.  The warning
    David> seems to indicate to me that the xor takes place just
    David> fine, then the result is being unboxed for some
    David> reason?!?  

Yes, that's right.  It has to box it up to store it away in
hash-code.  I sometimes wish there was some way to just smash in the
new bits into the storage that was already allocated to hash-code, but
I don't know how to do that.

Ray

Reply via email to