[swift-evolution] Proposal: Contiguous Variables (A.K.A. Fixed Sized Array Type)
dabrahams at apple.com
Sat Jan 30 14:14:38 CST 2016
on Fri Jan 29 2016, Joe Groff <swift-evolution at swift.org> wrote:
>> On Jan 29, 2016, at 1:11 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>> on Thu Jan 28 2016, Chris Lattner <swift-evolution at swift.org> wrote:
>>>> On Jan 28, 2016, at 9:41 PM, Félix Cloutier <felixcca at yahoo.ca> wrote:
>>>> I think that (4 x Int) needs to be syntax sugar for (Int, Int, Int,
>>>> Int). Not having them the same would introduce awkward cases into
>>>> the language.
>>> Agreed. This means that:
>>> let values: (4 x Int)(repeatedValue: 0) // Is this possible?
>>> will not be possible.
>> I think this avenue leaves some really crucial use-cases on the table,
>> e.g. implementing bounded-size dynamically-growable arrays.
> It doesn't foreclose on the future possibility, either. With integer
> generic parameters you could conceivably build something like that out
> of a primitive fixed-size tuple type.
I know, but I am not a fan of designing language features that are
clearly related to other things we definitely will want to do without
considering specifically how those other things fit into the picture.
More information about the swift-evolution