I'm totally new to Nim, and am trying to modify values in a table. Specifically, I'd like to append items to a sequence stored as a value in a table. My current code looks like:
import tables
var table = initTable[string, seq[string]]()
table["a"] = @["foo"]
var x = table["a"]
x.add("bar")
echo $table
The table entry "a" just contains ["foo"] and not ["foo", "bar"], which I'm guessing is because accessing table["a"] is returning a copy of the sequence that was originally inserted. How do I access (a reference to) the original seq, and not a copy? Thank you!