[swift-users] What makes a good lazy procedure? And how to do it?

Ben Cohen ben_cohen at apple.com
Mon Jan 8 14:57:13 CST 2018

> On Jan 8, 2018, at 9:04 AM, Daryle Walker <darylew at mac.com> wrote:
> I saw that I missed this discussion when I skipped out for 1.5 months. I’m not sure what the problem with IndexDistance was; abstraction is generally a good thing.

Abstraction is a means, not an end. Abstractions that result in impedance with little benefit are bad. IndexDistance was a clear case of this.

>> What’s also interesting is you could (with conditional conformance now that’s landed) make it a RandomAccessCollection if the base were random access, but not if the base is bidirectional, because you need to be able to calculate the size of the last element in constant time.
> Is this active, at least in Xcode 9.2?

Xcode 9.2 shipped with a variant of Swift 4.0. IndexDistance should be removed in 4.1 and later. You can try it in Xcode today though by downloading the latest master or 4.1 snapshot toolchain from swift.org <http://swift.org/>.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20180108/dc82e57d/attachment.html>

More information about the swift-users mailing list