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

Erica Sadun erica at ericasadun.com
Fri Jan 29 12:52:02 CST 2016


The advantage in going with a "only allow a single member of type T that initializes across the entire tuple" is that it enforces safety and simplicity.

-- E

> On Jan 29, 2016, at 11:43 AM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On Jan 28, 2016, at 9:24 PM, FĂ©lix Cloutier <felixcca at yahoo.ca> wrote:
>> 
>> To me, it's closely related to the declaration issue. By introducing a (N x Type) syntax, we're solving the LHS problem but leaving the RHS problem intact. If we want to spin it off into a separate proposal, I think that the most logical split is to have a proposal for subscripts on uniform tuples, and a a proposal for the shorthand syntax and a way to initialize values of these types.
> 
> Just spitballing…we could bring the N x <expr> syntax to expressions as well, so that (5 x 0) is (0,0,0,0,0), and maybe (1, 3 x 0, 2) is (1, 0, 0, 0, 2). With integer literals it's hard to tell which side is which, though...
> 
> -Joe
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list