In your example there’s not a single dynamic array…
[?]T is a fixed array for which the compiler figures out the size. Your transmute type is also a wanna be fixed array, with the exception that len() is runtime so that wouldn’t even work. Casts/transmutes needs types at compile time.
Sure, but if you don’t put the code you tried and didn’t work with an error message from the compiler or a print of what you expected to see, it just makes the person trying to help scratch his/her head trying to guess what you mean.
OP asked about slices and dynamic array transmute, but showed a fixed array which was also incorrectly transmuted. This begs the question if there’s a misunderstanding of what [?]T is even before we talk about slices and dynamic arrays.
Since, to my knowledge, Odin does not have a predefined type for a 2-dimensional point or vector, I wanted to declare a function that would receive an array of such data independent of how it was implemented in that program. The user may have defined his/her own point struct. But to circumvent the problem, I decided to instead receive data on the form [[x,y][x,y],[x,y],…]. Which should be easier to cast into, fram whatever type the user has declared.
And there’s a bunch of predefined stuff in linalg including 2D vector type aliases.
So far I really only seen 2 ways of people writing a point type in Odin:
Point :: [2]f32
Point :: distinct [2]f32
The first one just works with all the predefined maths in linalg, the second is if you want to force casting and be a little bit more type safe. Structs not really used because you’d need to implement everything that arrays already support.