Hashsets

A hash set stores objects and allows efficient lookup whether an object is already a member of the set.

datastructures currently provides a reference implementation of hashsets using a hashtable stored in a plain &GAP; list.
API

true or false Category of hashsets Create a new hashset. The optional argument values must be a list of values, which will be inserted into the new hashset in order. The optional argument hashfunc must be a hash- function, eqfunc must be a binary equality testing function that returns true if the two arguments are considered equal, and false if they are not. Refer to Chapter about the requirements for hashfunctions and equality testers. The optional argument capacity determines the initial size of the hashmap.

Add obj to hashset. Test membership of obj in hashset Remove obj from hashset. Return the size of a hashset Returns an integer a boolean Test a hashset for emptiness. a set Convert a hashset into a &GAP; set an immutable set Convert a hashset into a &GAP; set an iterator Create an iterator for the values contained in a hashset. Note that elements added to the hashset after the creation of an iterator are not guaranteed to be returned by that iterator.