https://nim-lang.org/docs/tables.html#allValues.i%2CTable%5BA%2CB%5D%2CA
I suppose it returns extra values for hash collisions, but I would expect hash collisions to lead to chaining, not extra values for the same key. Can a Table actually have multiple values for the same key?
While it is a little unusual to see it, open addressed tables can support multiple keys (as a set or associatively as a table). I believe most other collision resolution schemes can, as well. So, a Nim Table is what some people call a "multi-set". Whether you have unique keys depends upon the history of an instance.
When I was sprucing up the impls, I mentioned to Araq this might confuse some, but he said he uses this feature in the compiler proper. I think his was the right judgement call..Better to just inform about more than usual functionality when it comes up. To my memory, this is the first time it's come up 4 years. ;-)
proc add():
puts a new (key, value) pair into t even if t[key] already exists. This can introduce duplicate keys into the table!
I see now. allValues() is the analogue to add(). I assume that del() and take() remove the entire list of values that were added for a given key. And I assume that the "put" procs all ensure that there is only a single value for a given key, even if there had been multiple values before the put. Otherwise, I have no idea how to undo multiple add() calls. I think this is the missing piece in the documentation.