[swift-evolution] Figuring out what you get for free

Félix Cloutier felixcloutier at icloud.com
Sun Sep 17 17:00:05 CDT 2017


I found that for Sequence, but Sequence is far from the only protocol with default implementations, and not all of them have maintainers willing to write and update documentation to the degree that Apple will.

Félix

> Le 14 sept. 2017 à 15:10, Kyle Murray <kyle_murray at apple.com> a écrit :
> 
> 
>> However, I find that I'm having trouble figuring out what I get for free when I implement a protocol. In principle, I like conditional conformances and synthesized implementation of protocol methods, but I find that they both make it harder to figure out what I need to implement, and what are going to be the performance characteristics of methods that I choose to not implement.
> 
> 
> If you're thinking specifically about the standard library, the documentation for protocols like Sequence shows whether a member is required, and whether it provides a default implementation.
> 
> https://developer.apple.com/documentation/swift/sequence#2923865 <https://developer.apple.com/documentation/swift/sequence#2923865>
> 
> Have you noticed that before, or is it still tricky to find requirements given the presentation?
> 
> -Kyle

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


More information about the swift-evolution mailing list