[swift-evolution] Keyword for protocol conformance
Xiaodi Wu
xiaodi.wu at gmail.com
Thu Aug 25 22:24:51 CDT 2016
Yes, and it's covered in those previous threads. In brief, not all
retroactive modeling involves extending a type:
* A vendor supplies you with a closed-source library with a struct S that
conforms to standard library protocol P.
* Protocol P requires a method named foo(), so struct S has its own
implementation of foo().
* You extend protocol P by adding a new default implementation of foo().
This cannot be done if a keyword is required for overriding a default
implementation. There is also nowhere for you to append any sort of "retro"
keyword anywhere, because no part of your own code extends S in any way.
Please, please take the time to study the previous threads; we should not
be re-playing existing discussions four or five times on this list.
On Thu, Aug 25, 2016 at 10:06 PM, Charles Srstka <cocoadev at charlessoft.com>
wrote:
> Is there a reason that adding a “retro” keyword on extensions meant to
> retroactively apply a protocol is unacceptable?
>
> Charles
>
> On Aug 25, 2016, at 6:44 PM, Xiaodi Wu via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> Chris, as I wrote above, this idea has been discussed previously on
> several occasions, and the principal reason why it has been abandoned each
> time is that it cannot accommodate retroactive modeling. I'll refer you
> again to three previous threads discussing this and closely related matters:
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160825/354924f2/attachment.html>
More information about the swift-evolution
mailing list