var blah = newSeq[int](10)
for i in 0..<10:
blah[i]=10
blah[i]+=1
echo blah # shows 11's
var blah1 = newSeq[string](10)
for i in 0..<10:
blah1[i]="haha"
blah1[i].add("addingmore")
echo blah1 # shows "hahaaddingmore"
How can I mimic this behavior for a custom type? I have already defined the [] and []= operators, but I want to do things like [].add and []+=. Is this possible?
This has been asked before on SO (but with a not so clear title):
http://stackoverflow.com/questions/29461573/nim-operator-overloading