[swift-evolution] [Review] SE-0065 A New Model for Collections and Indices

Taras Zakharko taras.zakharko at uzh.ch
Mon Apr 11 07:13:55 CDT 2016


> 	* What is your evaluation of the proposal?

+1. I think it makes the collection model more simple and more flexible at the same time. By coupling index to a specific collection, rather then treating it as a separate, independent entity, we can more easily implement alternative collections. For instance, I have recently needed a collection that wraps around the end of a sequence, e.g. 

[1, 2, 3, 4, 5].[wrappingFrom: 3, end: 2] == [4, 5, 1, 2]

With the current model, implementing indexes that do this kind of wrapping is quite messy, because a lot of collection-specific state needs to be stored within the index. With the new model, it becomes much simpler. 

> 	* Is the problem being addressed significant enough to warrant a change to Swift?

I think so. The model where index has its own, independent properties is too rigid. It might be possible to work around the limitations of that model with using more advanced generics(e.g. where type information depends on values such as dimensionality etc.), but the proposed new model is much simpler and potentially allows better performing code. 

> 	* Does this proposal fit well with the feel and direction of Swift?

Yes

> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?


Followed the thread, experimented with implementing various non-trivial collections myself (in Swift and outside Swift)

> On 10 Apr 2016, at 23:41, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hello Swift community,
> 
> The review of "A New Model for Collections and Indices" begins now and runs through April 18th. The proposal is available here:
> 
> 	https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md <https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md>
> 
> Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at:
> 	https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> or, if you would like to keep your feedback private, directly to the review manager.
> 
> 
> What goes into a review?
> 
> The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
> 
> 	* What is your evaluation of the proposal?
> 	* Is the problem being addressed significant enough to warrant a change to Swift?
> 	* Does this proposal fit well with the feel and direction of Swift?
> 	* If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> 
> More information about the Swift evolution process is available at
> 
> 	https://github.com/apple/swift-evolution/blob/master/process.md <https://github.com/apple/swift-evolution/blob/master/process.md>
> 
> Thank you,
> 
> -Chris Lattner
> Review Manager
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

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


More information about the swift-evolution mailing list