> On Jul 23, 2017, at 4:27 PM, Félix Cloutier <[email protected]> wrote:
> 
>>> 
>>> Well, fixed-size arrays don’t have initializers, for the same reason tuples 
>>> don’t: they’re compound types instead of named types and they literally 
>>> have nowhere to place initializer definitions. But like tuples, FSAs have a 
>>> literal syntax that works as a substitute for full-blown initializers.
>> 
>> Ok, sure.  They aren’t literally initializers in the stdlib (they are built 
>> into the compiler), but they have initialization semantics and can be 
>> spelled in whatever way makes ergonomic sense.  Keeping them aligned with 
>> Array seems like a good starting point.
> 
> Either way, in the context of fixed-size arrays, I think that it's a broader 
> problem that anonymous types can't have anything attached to them. This also 
> prevents fixed-size arrays from conforming to protocols, even Sequence, and 
> Swift would need variadic generics or (possibly, depending on the syntax) 
> non-type generic parameters to even create a wrapper.

Agreed. However, solving that general problem is hard, and completely 
orthogonal to the win of having fixed sized arrays work.

-Chris

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to