[Pitch] InlineArray type sugar

Given that there are some concerns about using x as a multiplication-like operator with whitespace around it, has anyone thought instead about dropping the leading whitespace, similar to “2x {thing}” in English?

// When the size of the array is a literal:
let literalArray: [5x Int] = …
let multiDimensionalArray: [10x [10x Int]] = …

// When the size of the array is a parameter, parentheses are required:
let parameterizedArray: [(N)x Int] = …
let otherParameterizedArray: [(N * x)x Int] = …

I’m sure that causes hassles in parsing, but it’s easy to type, has precedence in everyday language, and is unambiguous with the use of parentheses (which would only be allowed to be omitted if the size is a literal).

2 Likes