[swift-evolution] Mark protocol methods with their protocol

Karl razielim at gmail.com
Tue Sep 20 17:29:54 CDT 2016


> On 21 Sep 2016, at 00:08, Vladimir.S <svabox at gmail.com> wrote:
> 
> On 21.09.2016 0:28, Karl via swift-evolution wrote:
>> 
> 
> I don't understand. Do you feel that this:
> 
> class MyClass : MyProto {
>    var MyProto.aVariable : Int
>    func MyProto.aFunction() { … }
> }
> 
> better than this:
> 
> class MyClass : MyProto {
>    implement var aVariable : Int
>    implement func aFunction() { … }
> }
> 
> ?

Yes, because “implement” doesn’t say anything. It would need to be “implements <ProtocolName>” to be useful to a person or to the type-checker. 

At that point, why not just say MyProtocol.aVariable? It feels more natural IMO.

And then the rest kind of snowballs from there...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160921/0dcc6edf/attachment.html>


More information about the swift-evolution mailing list