> I simply dislike the syntax, which in my opinion does not fit to Swift.
+1

Also, I might have a different focus for the feature:
Performance and C interoperability are important, but I just want type safety 
and to avoid creating stupid things like Vector3, Vector4… which can't share 
code because there's no inheritance for structs (yet), and which are limited in 
expressiveness.

I don't think arrays should be multidimensional: Memory has only one dimension, 
this is a low level feature — and it's easy to build multi-dimensional 
structures on top of simple arrays.

I also have little need for a special syntax for literals: When the array is 
used as communication medium ("this function returns an array of size 3"), I'm 
not using literals at all, and when I'm declaring a array for my own use, I 
wouldn't mind if the compiler decides on his own that it can be fixed size.
There's also the use case of creating an array that will be handed over to a 
method that expects a FSA, but I wouldn't mind if I have to declare the type 
explicitly in this case.

Bottom line:
I prefer only one addition, and that is an extension of the generics system 
that has already been brought up in the manifesto.
With generics, the syntax for arrays is quite intuitive ("let speed: 
Array<Float, size: 3>"), and the usefulness isn't limited to FSAs alone — after 
all, Swift  is used in production for several years now without proper support 
for them.

Tino
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to