[swift-evolution] Range and ClosedRange
Max Moiseev
moiseev at apple.com
Fri Jan 13 14:05:56 CST 2017
FWIW, the common RangeProtocol unifying both Range and ClosedRange existed for a while when the new collection indexing model was being implemented.
Here is the commit removing it: https://github.com/apple/swift/pull/2108/commits/8e886a3bdded61e266678704a13edce00a4a8867 <https://github.com/apple/swift/pull/2108/commits/8e886a3bdded61e266678704a13edce00a4a8867>
Max
> On Jan 12, 2017, at 12:11 PM, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
>
> Hello,
>
> Since the release of Swift 3, I’ve seen quite a few people (me included) experience a lot of friction with the new types for representing ranges. I’ve seen people confused when writing an API that takes a Range as argument but then can’t pass in a ClosedRange. Sometimes this can be fixed because the API should be written against a more general protocol, but sometimes that’s not the case.
>
> Those new types definitely seem to cause more problems than they fixed (the Int.max problem). Has the Standard Library team put any thought into this?
>
> Regards,
> David.
> _______________________________________________
> 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/20170113/37a953da/attachment.html>
More information about the swift-evolution
mailing list