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

SXHASH isn't process-independent (bug)



SXHASH, According to Steele, page 285, must have the following property:

     The manner in which the hash code is computed is implementation-
     dependent, but is independent of the particular "incarnation" or
     "core image."  Hash values produced by SXHASH may be written out
     to files, for example, and meaningfully read in again to an
     instance of the same implementation.

However, KCL SXHASHes symbols simply by casting them to integers (taking
their address as a fixnum).  Hence it is not invocation-independent.
For example,

Invocation 1:

     staffa 26% kcl
     KCl (Kyoto Common Lisp)  June 3, 1987

     >(sxhash 'zorn)
     421772

Invocation 2: this time ZORN has a different address:

     staffa 27% kcl
     KCl (Kyoto Common Lisp)  June 3, 1987

     >'lemmon
     LEMMON

     >(sxhash 'zorn)
     421763

SXHASH should change, but the hash for EQ hash tables, used now by SXHASH,
should not change since it doesn't need to have this property.

Jeff Dalton,                      JANET: J.Dalton@uk.ac.ed             
AI Applications Institute,        ARPA:  J.Dalton%uk.ac.ed@nss.cs.ucl.ac.uk
Edinburgh University.             UUCP:  ...!ukc!ed.ac.uk!J.Dalton