Re: must SRFI-128 mustard be taken seriously? John Cowan 11 May 2016 03:54 UTC

William D Clinger scripsit:

> I'm basically saying the same argument holds for circular lists
> as well as for vectors.  The argument would also hold for any
> other structures that might be circular, such as procedures
> whose representations involve circularity (as is often the case
> because that's a standard way to implement recursion and scope).

In that case, all the objects affected are out of scope for SRFI 128,
and you can do whatever you like: the rules given in the SRFI don't apply.

> If that's the intent, then the SRFI 128 mustard was intended to
> preclude efficient implementation of an always-terminating version
> of default-hash, because the standard way to achieve an efficient
> always-terminating hash function looks at only a bounded portion
> of its argument.

Do I understand correctly that when given a non-circular vector, the
SRFI 126 hash procedure examines only at most a fixed number of elements?
That seems to me problematic.  The original version of Java's String#hash
function examined at most 16 characters of the string being hashed,
which tended to cluster results badly.  Consequently, Java 1.2 replaced
it with a function that examined all the characters, essentially similar
to the SRFI 128 sample implementation.  Undoubtedly the new algorithm
was slower in many cases, but it delivered better results.

--
John Cowan          http://www.ccil.org/~cowan        xxxxxx@ccil.org
Fundamental thinking is ha-ard.  Let's go ideology-shopping.
                        --Philosopher Barbie