implemented tables.add

This commit is contained in:
Araq 2011-06-11 17:03:45 +02:00
commit ec2bd53ead
4 changed files with 26 additions and 11 deletions

View file

@ -26,7 +26,7 @@ type
TSlotEnum = enum seEmpty, seFilled, seDeleted
TKeyValuePair[A] = tuple[slot: TSlotEnum, key: A]
TKeyValuePairSeq[A] = seq[TKeyValuePair[A]]
TSet* {.final, myShallow.}[A] = object
TSet* {.final, myShallow.}[A] = object ## a generic hash set
data: TKeyValuePairSeq[A]
counter: int
@ -141,7 +141,7 @@ proc `$`*[A](s: TSet[A]): string =
## The `$` operator for hash sets.
dollarImpl()
# ------------------------------ ordered table ------------------------------
# ------------------------------ ordered set ------------------------------
type
TOrderedKeyValuePair[A] = tuple[