I can understand that declarations like InlineArray<3, Int> are verbose, but it seems that the verbosity could be cut down significantly by introducing a typealias, as others in the thread have mentioned.
I think it would make sense to first have InlineArray actually ship in a general release and see if using a typealias addresses the problem. And then if not, revisit this proposal.
I also see a number of comments in the review thread trying to see if the proposed syntax will translate well into the value sugar syntax. I think the two are so closely related that they should be proposed and considered together.
Is the problem being addressed significant enough to warrant a change to Swift?
Since InlineArray itself hasn't been released as part of a general Swift release, it seems like it is impossible to tell how significant the problem is across the Swift community.
Does this proposal fit well with the feel and direction of Swift?
It's always seemed to me that Swift is generally slow to add sugar and only after the pain point of not having the sugar has been demonstrated over time.
This proposal seems like the complete opposite with a rush to sugar something that hasn't even been in a general release of the language.
How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
I read the proposal a few times, read through a lot of the review thread, and did my own little mockup of different variations of alternative sugar.
That's part of why the inline+repeat proposal expressly prohibits that locution [edit: when standalone]. For literals (as a future direction), it would be [6 inline repeat 7] (which itself has drawbacks mentioned up-thread).
If we had to add a syntax sugar, I'd vote for β[100, Int]β because it's consistent with the structure of InlineArray<100, Int>. As for x/X or *, all I can say is that it looks like a matrix rather than an array
And when nested, it's more readable if we separate them with β,β:
[100, [3, [2, Int]]]
Thank you all for your candid feedback. The proposal author has revised the proposal to change the separator from x to of, and to incorporate more discussion of the concerns raised in this review discussion.
Iβve kicked off a revision review of these changes. Please continue the review discussion in this thread: