SE-0483: `InlineArray` Literal Syntax

I commented the pitch thread that the inline nature of this type would be clearer of it was spelled 8 of Int with no brackets to emphasize the inline nature of the array. I still stand by this position.

(This could work with 8 x Int too, even though I prefer of.)

var x: [Float]      // regular array
var y: 100 of Float // inline array
// or:
var y: 100 x Float  // inline array

Nothing makes it feel more inline than not wrapping it brackets.

Examples with “of”
 // tuple
var z: (100 of Float, 50 of Double)

 // function signature
func foo(components: 16 of Int)

// generic arguments
var s: Set<16 of Int>

// mixed with existing collection sugar:
var d: [String: 16 of Int] // Dictionary<String, 16 of Int>
var a: [16 of Int] // Array<16 of Int>
Examples with “x”
 // tuple
var z: (100 x Float, 50 x Double)

 // function signature
func foo(components: 16 x Int)

// generic arguments
var s: Set<16 x Int>

// mixed with existing collection sugar:
var d: [String: 16 x Int] // Dictionary<String, 16 x Int>
var a: [16 x Int] // Array<16 x Int>
8 Likes