[swift-evolution] [Accepted] SE-0191: Eliminate IndexDistance from Collection

Karl Wagner razielim at gmail.com
Mon Dec 4 12:53:45 CST 2017


But you noted in that thread that "(Int.min..<Int.max).count” is larger than you can fit in an Int, and causes a crash today. If we remove IndexDistance, that behaviour is locked-in, is it not?

I would love to make generic programming against Collection more convenient, but that seems like quite a large cost which wasn’t made clear in the proposal. I also note that people only expressed support for the proposal before Xiaodi pointed it out, and not afterwards (although its possible my email program missed/misplaced some messages, it does happen...).

- Karl

> On 4. Dec 2017, at 19:39, Ben Cohen via swift-evolution <swift-evolution at swift.org> wrote:
> 
> They will continue to conform to Collection just as they do today. Range<Int>.IndexDistance is already an Int.
> 
>> On Dec 4, 2017, at 10:35, Karl Wagner via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> What does this mean for ranges of integers, as Xiaodi mentioned in the review thread? Can they still conform to Collection? 
>> 
>> I think we really need clarification on that aspect. Personally, I would consider it a deal-breaker.
>> 
>> - Karl
>> 
>>> On 4. Dec 2017, at 18:57, Douglas Gregor via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> 
>>> Proposal Link: https://github.com/apple/swift-evolution/blob/master/proposals/0191-eliminate-indexdistance.md <https://github.com/apple/swift-evolution/blob/master/proposals/0191-eliminate-indexdistance.md>
>>> 
>>> Hello Swift Community,
>>> 
>>> The review of SE-0191 "Eliminate IndexDistance from Collection” ran from November 27…December 3, 2017. The proposal is accepted. Feedback for this simplification to the Collection protocols was positive.
>>> 
>>> Thank you to everyone who participated in the review!
>>> 
>>> 	Doug Gregor
>>> 	Review Manager
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> 
> _______________________________________________
> 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/20171204/9d9379b3/attachment.html>


More information about the swift-evolution mailing list