HashSet<a> newHashSet(Int buckets=157, Int(a) hashfn=hash)
buckets: The number of hashing buckets to use. A larger number of buckets increases the speed of the dictionary (up to a limit) but uses more memory. A good choice is the nearest prime number to
1.5*(expected number of entries), with the default being 157.
hashfn: The hashing function to use. This function must take a key, and return an integer. A good hashing function will return different values for similar keys (but must of course always return the same value for the same key!). A default built-in hashing function is provided, though if the keys are of type
String, the Builtins::strHash function should be used instead, and if the keys are of type
Intyou may use Builtins::identity (though an array may provide faster insertion and lookup if the keys are positive and either small or largely sequential). If the keys are an especially complex data type, it may again be best to write your own hashing function. This argument may be omitted and defaults to Builtins::hash.
Create a new empty HashSet.