[swift-evolution] Abstract methods

Mike Kluev mike.kluev at gmail.com
Mon Nov 6 13:57:00 CST 2017


On 6 November 2017 at 19:44, Tino Heth <2th at gmx.de> wrote:

> to me protocol extensions are both cool and evil. cool as you can add
> code. evil because it's more natural to add another declarations in those
> extensions rather than implementation:
>
> protocol Foo {
>     func foo()
> }
>
> extension Foo {
>    func bar()    //*** natural assumption is that i can do this. but i
> can't
> }
>
> After a moment of reflection, I think I understand your reasoning — but
> why should you want to do this?
> Imho splitting types with extensions is already overused quite often, but
> splitting a protocol makes no sense for me at all.
>

the use case would be splitting my own big protocols into different parts
for code organizing purposes (so it's within the module boundaries).

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171106/26b87cba/attachment.html>


More information about the swift-evolution mailing list