3.31. kink/container/HASH_SET

Provides a set implementation backed by a hash table.

3.31.1. HASH_SET.new($hash ...[$config={}])

HASH_SET.new makes an empty hash set.


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

• $config, 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 set. $eq? must take two elems. If not called, the set uses {(:X :Y) X == Y } as the default equivalence fun.

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

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