carbon-lang
carbon-lang copied to clipboard
Reorder type and length in array type syntax
This proposal is to have the syntax for an array type specify the length before the type to address the issue that array extents are in reverse order from how the array is indexed. That is, given an array of length 5, each element of
which is an array of 10 i32
s, consider a variable declaration along with an
indexing into the "last" element.
Before:
var array: [[i32; 10]; 5]
var element: array[4][9]
After:
var array: [5; [10; i32]]
var element: array[4][9]