sets
nimony/lib/std/sets.nim
type HashSet = object t: Table[T,bool]
func initHashSet(): HashSet[T]Constructs an empty
HashSet.func incl(s: var HashSet[T]; x: sink T)Inserts
xintos.func excl(s: var HashSet[T]; x: T)Removes
xfromsif present.func contains(s: HashSet[T]; x: T): boolTrue if
xis ins.func containsOrIncl(s: var HashSet[T]; x: T): boolTrue if
xwas already present; otherwise inserts it and returns false.func missingOrExcl(s: var HashSet[T]; x: T): boolReturns true if
xwas not ins(the element was missing). Otherwise removesxfromsand returns false.iterator items(s: HashSet[T]): lent TYields each element currently stored in
s.func len(s: HashSet[T]): int64Number of elements in the set.
func intersection(a: HashSet[T]; b: HashSet[T]): HashSet[T]Elements present in both
aandb.func incl(s: var HashSet[T]; other: HashSet[T])Union
otherintos.func excl(s: var HashSet[T]; other: HashSet[T])Remove every element of
otherfroms.