I have a vague memory of someone tweeting me a way to avoid having to put a type annotation on every field in an array like so:
var gradZ = [ 0'f32, 0'f32, 0'f32, 0'f32, 1'f32, 1'f32,-1'f32,-1'f32, 1'f32, 1'f32,-1'f32,-1'f32]
But I can't remember, is there a way?
let myArray: array[auto, float32] = [1, 2, 3, 4]
I generally use the fact that you can omit the parentheses (or dot) for conversions of literals, leading to a pretty natural looking notation:
let a = [float 1, 2, 3, 4] let b = [int8 1, 2, 3, 4]