If I want to iterate over the inner elements of a static 2D array using transmute is a comfortable way to go about it:
st_array: [3][2]int = { {1,2}, {3,4}, {5,6} }
for x,i in transmute([6]int) st_array do fmt.println(i, "=>", x)
with the output being unsurprising
0 => 1
1 => 2
2 => 3
3 => 4
4 => 5
5 => 6
However, iterating over a dynamic array of [2]int values in the same way
dy_array: [dynamic][2]int = {}
append_elems(&dy_array, [2]int {1,2}, [2]int {3,4}, [2]int {5,6})
for x,i in transmute([dynamic]int) dy_array do fmt.println(i, "=>", x)
seems to only iterate over as many elements exist in the outer dimension, rather than over the entire array:
0 => 1
1 => 2
2 => 3
Sure you could just do it explicitly with a nested loop, but is there an idiomatic way to reinterpret a dynamic 2D array as a flattened array in order to iterate its inner elements that behaves in the same way as a static array?