proc with[K, V](T: typedesc[array], vals: openArray[(K, V)]): T = for (i, x) in vals: result[i] = x var a = array[char, int].with {'a': 10, 'b': 20, 'z': 40} echo a