Outputs the hashcode of an object. The hashcode operation must satisfy the following properties:
• | If two objects are equal under =, they must have equal hashcodes. |
• | If the hashcode of an object depends on the values of its slots, the hashcode of the slots must be computed recursively by calling hashcode* with a level parameter decremented by one. This avoids excessive work while still computing well-distributed hashcodes. The recursive-hashcode combinator can help with implementing this logic, |
• | The hashcode should be a fixnum, however returning a bignum will not cause any problems other than potential performance degradation. |
• | The hashcode is only permitted to change between two invocations if the object or one of its slot values was mutated. |
If mutable objects are used as hashtable keys, they must not be mutated in such a way that their hashcode changes. Doing so will violate bucket sorting invariants and result in undefined behavior. See
for details.