If I understand your problem right it might be a bit of confusion over how nim 
stores data. A big advantage of tuples is that their size is known at compile 
time which means that you can use them anywhere where a built in value type 
like an int could be used - within composite types, in the data or bss segment, 
the stack and so on. This however does mean that you can't create new tuple 
sizes at run time.

The thing all these locations have in comman is that the size of the data has 
to be known at compile time to use them. Anything with dynamic size has to be 
placed onto the heap which does a certain amount of householding to track which 
blocks of memory are taken or freed which in turn does impose significant 
runtime costs.

Long story short: If you want a dynamic length sequence of (int, string) tuples 
you probably want to use seq[(int, string)] or something equivalent using a seq 
of objects.

Reply via email to