Hi all, I have a problem finding a solution for a problem (or perhaps i am looking the wrong direction). I want to check if a key is already set and if that is the case, overwrite it with the new value. Off course there is the possibility to walk through the whole sequence to see if a key exists, but is there a smarter way?
I only have this code : type DataBuffer* = tuple key : string mytype : string value : string var mydata = newSeq[DataBuffer]() mydata.add(("a","int","4")) mydata.add(("a","int","5")) echo mydata # if expect only the last add to be visible ([a, int, 5])