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

Reply via email to