[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SXHASH



    Date: 15 December 1979 18:51-EST
    From: Vaughan Pratt <PRATT at MIT-MC>
    Any chance of getting sxhash a little more random?  At present it maps all
    permutations of a list to the same number, . . . 
Probably not - SXHASH is used by faslap/fasload in a "heuristic" way, but
the gain to them by changeing sxhash is too small to be worth the risk of
new bugs;  likely in NIL, we'll define sxhash to permute in the CAR direction
instead of the CDR direction, and thus satisfy most users.  If you use the
built-in SXHASH for atoms, it would be almost trivial to write your own version
of it for non-atoms.
    It would also be nice if atoms were hashed a little more thoroughly - at
    present (A Z), (B Y), (C X) etc. all hash to the same thing.  All these
    coincidences wreak havoc with any program using sxhash to implement its
    own obarray.
Yea, this coincidence is unfortunate.  I think if you had a version of sxhash
which permuted down the car direction instead of teh cdr, you wouldn't
be bothered by its peculiarities.  (The reason why you "want" it to permute
down one of the directions is so that the recursive definition of sxhash
will be some understandable piece of code in which the sxhash of a particular
node is definable in terms of the sxhash's of the car and cdr of that node.)