[swift-evolution] Fixed-sized arrays

Daryle Walker darylew at mac.com
Sat Jul 2 20:34:04 CDT 2016


> On Jun 26, 2016, at 2:20 AM, Félix Cloutier <felixcca at yahoo.ca> wrote:
> 
> There have been proposals about that, revolving around creating a new tuple syntax for fixed-size arrays, like (Int x 5), and adding a subscript to them. IIRC, the sentiment was largely positive but people couldn't agree on the specific syntax.
> 
> I pushed a little bit for CollectionType on these, regardless of the type syntax (could have been (Int, Int, Int, Int, Int) for all I was concerned), but there were apparently important implementation challenges stemming from tuples being non-nominal types.
> 
> https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160208/009682.html <https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160208/009682.html>
> 
> I would like to revive this discussion, but I'm afraid that we're getting late for the Swift 3 release.

From a quick look, the previous threads’ tuple-array quasi-equivalence would work for one-dimensional arrays, but I want to go beyond what C has and do multi-dimensional arrays too (co-equal coordinates, not just C’s nested arrays).  Of course a non-linear structure brings questions on how to visit/traverse every element; the existing sequence and collection protocols assume linearity, as well as the “for” statements that use said conforming types.

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160702/5ce5cede/attachment.html>


More information about the swift-evolution mailing list