4.30. kink/container/HASH_MAP

Provides a map implementation backed by a hash table.

4.30.1. HASH_MAP.new($hash ...[$config_fun={}])

HASH_MAP.new makes an empty hash map.

Preconditions:

• $hash must be a fun which takes a key and return an int num. It is used as the hash fun of the map.

• $config_fun, if given, must be a fun which takes a conf val.

The conf val provides the following method:

• C.eq($eq?) : uses $eq? as the equivalence fun of the map. $eq? must take two keys. If not called, the map uses {(:X :Y) X == Y } as the default equivalence fun.

The equivalence fun must take two keys, and return true if they are equivalent, or false otherwise. The map uses the equivalence fun to determine equivalence of keys.

The hash fun must take a key, and return an int num. The hash fun must return the same int num for equivalent keys.