Wrapped Hashtable protocol


The hashtables.wrapped describes a protocol for defining hashtables that use custom hashing algorithms.

To create a custom wrapped hashtable, you must define a wrapper for your keys (usually a tuple class). For this wrapper, you have to define the following generics:
â€ĸ hashcode* for your wrapper, which will contain the hashing algorithm you want to use.
â€ĸ wrap-key which is effectively a constructor for wrapping keys.
â€ĸ equal? to check for equality of keys.


The key wrapper must implement underlying>> to retrieve the original key.

Other relevant generics are clone and new-assoc.

Examples of wrapped hastable objects can be seen in:
â€ĸ hashtables.identity
â€ĸ hashtables.sequences
â€ĸ hashtables.numbers