[swift-evolution] Proposal: Contiguous Variables (A.K.A. Fixed Sized Array Type)

Joe Groff jgroff at apple.com
Thu Jan 28 23:15:18 CST 2016

> On Jan 28, 2016, at 7:12 PM, Justin Kolb <justin.kolb at gmail.com> wrote:
> I’m not sure I like the fact that they would be associated with tuples. As far as I’m aware tuples don’t have a public or well documented memory layout and most likely it would be better to keep them that way. To be compatible with C a fixed size array would have to have similar memory layout requirements. Also I assume there was a reason not to allow subscripting of tuples originally and adding it to something similar might confuse things. If any of these things are non-issues then I’m fine with them looking like tuples. I do think they will need to be able to be initialized with array like initializers in some form.

I don't think this is an issue. Practically speaking, there isn't anything we could do layout-wise for a homogeneous tuple in memory that would be better than a contiguous array.


More information about the swift-evolution mailing list