tcl's dict type is exactly what we need for this problem: an order-preserving de-duplicated list of key-value pairs.