Florian Weimer <fw@...> writes:
> Christophe Rhodes <csr21@...> writes:
>
> > So, bearing in mind that DEPTHOID is at most 4, if the first four
> > elements of a bitvector are the same, SXHASH will give you the same
> > answer. I think it's fairly clear that that's not ideal...
>
> Oh, I see. 8-(
>
> I'm not really fixed to using bit vectors in this way. Anyway, I'm
> slightly concerned by the fact that there doesn't appear to be an
> efficient to treat parts of the bit vector as fixnums (something like
> LDB). If SXHASH worked on machine words instead of individual bytes,
> it certainly could look at more than just 4 bits...
>
> The bit vectors I'm interested in are between 0 and 32 bits long. I
> could use a vector of five octets (four for the bits and one for the
> length), and get away without a hashed length. Hmm.
If your application isn't of a "right now this moment" priority, I'm
fairly sure that I or someone else can come up with a fix for this
behaviour, either generally or for you specifically in the next week
or so.
I can't promise anything, obviously, in that I haven't had time to
explore the problem space, but a solution exists, and it's probably
just a matter of finding it. For instance, there are
(implementation-specific) primitives that we have access to that can
access the elements of this kind of bit-vector as an (unsigned-byte
32), so we could definitely do better than what we have.
Cheers,
Christophe
--
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)
|