import tables
type
Factorization = ref object of OderedTable[int, uint]
proc initFactorization() : Factorization =
return # an ordered table initialized with aa[0] = 0
Not sure how to make initFactorization() that just loads the table with aa[0] = 0 (D notation).
First of all, nim provides you a ref OrderedTable (OrderedTableRef, i hope they make refs the default type in the future). To instantiate it, you need to call newOrderedTable[int, uint](). And finally, to add a key-value, use myTable[0] = 0:
import tables
type
Factorization = OrderedTableRef[int, uint]
proc initFactorization() : Factorization =
result = newOrderedTable[int, uint]()
result[0] = 0 # Or maybe 0u