5.3 Comparison and Hash Functions

The WB-tree collections require an ordering on their elements or keys; the CHAMP collections require at least an equality predicate (and since they can fall back to WB-trees for collision sets, they may need an ordering as well).

An FSet comparison function must accept two arguments A and B and return one of these four symbols:

A hash function’s contract is simpler: it accepts an object and returns an integer. (This integer is not required to be a nonnegative fixnum; any integer is permitted.) When a hash function is used together with a comparison function, it must be the case that if the hash function returns distinct values on two objects, the comparison function must not return :equal on them.