Yes you can, you need to add it to the table so the result has an address:
import std/tables
proc `[]`(table: var Table[string, seq[int]], key: string): var seq[int] =
discard table.hasKeyOrPut(key, @[])
tables.`[]`(table, key)
var a = initTable[string, seq[int]]()
echo a["hello"]
a["hello"].add 20
echo a["hello"]
Run
- how to properly init a Table of seq tcheran
- how to properly init a Table of seq ElegantBeef
- how to properly init a Table of seq chancyk
- how to properly init a Table of seq ElegantBeef
