A common usability enhancement in programming languages is to allow trailing commas when defining data structures. This doesn't work in WGSL and the code below is invalid.
var pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
vec2<f32>(-1.0, -1.0),
vec2<f32>( 1.0, -1.0),
vec2<f32>(-1.0, 1.0),
);
Could we consider allowing trailing commas so that copy pasting lines like this works as expected and matches other languages? Having the function-like constructors might make this awkward though.
A common usability enhancement in programming languages is to allow trailing commas when defining data structures. This doesn't work in WGSL and the code below is invalid.
Could we consider allowing trailing commas so that copy pasting lines like this works as expected and matches other languages? Having the function-like constructors might make this awkward though.