Hello,

Olivier Dion <[email protected]> skribis:

>   scheme@(guile-user)> (= (hash '(1 2 3 4 5) most-positive-fixnum)
>                           (hash '(1 2 3 4 5 6) most-positive-fixnum))
>     => #t
>
> To me this screams that list hashing are fundamentally broken.  Only the
> first 5 elements are used for hashing.  This is why you got the same
> hash for both transformations.

One of the design goals for ‘hash’ is that it must be constant-time.
Thus, by definition, it cannot traverse entire lists or vectors.

I don’t see how to avoid that.

Thanks,
Ludo’.

Reply via email to