Mark protocol methods with their protocol

Hi,

The cases where you find these kinds of exact collisions are so rare
(never in my career) that it's fine if some manual work is needed.

I agree that such accidental collisions are quite rare (especially with the Swift way of naming methods which makes it quite easy to describe the semantics of the function).

However, I draw some other conclusion from it: I don't see why I should have to explicitly name the protocol in my methods. The method name is enough already to match it to the protocol.

We shouldn't complicate our language just for obscure cases where protocols accidentally collide.

···

Am 2016-09-27 16:51, schrieb Dave Abrahams via swift-evolution:

--
Martin

It took another good night’s sleep to be able to realise what I really wanted to express yesterday. It comes down to three points:

1) Protocol marking is not really a proposal, but a bug report.
2) I do not think it needs new syntax
3) There is probably a lot of code out there that “uses” this bug. Cause us to think that this is a source breaking change. It is not, but that existing code is “wrong” and needs to be redesigned.

I am not sure this covers all the cases discussed in this thread, I simply do not have to time to follow all discussions in full detail.

> -- module A --
> class A {
> func foo() {}
> }
>
> -- module B --
> protocol Foo {
> func foo()
> }
> extension A: Foo {}

let C = A()

I’d say that you have two functions here:
A.foo() and A.Foo.foo()

To call the first, write C.foo()
To call the second, write (C as! Foo).foo()

No ambiguity.

Note that A.foo() was never intended to be used as an implementation for protocol Foo, thus why should you be able to see it as such? That imo is a bug in the language. Its not flexibility, it’s dangerous.

Rien.

···

On 22 Sep 2016, at 18:27, Xiaodi Wu via swift-evolution <swift-evolution@swift.org> wrote:

Extensions in Swift aren't a first-class entity; they have no name and no representation in the type system. If an extension to A does something, then A does something. If A conforms to P, then A.foo is the implementation of P.foo.
On Thu, Sep 22, 2016 at 11:06 Marinus van der Lugt via swift-evolution <swift-evolution@swift.org> wrote:
That does not seem right to me. A does not implement any protocol.
The extension of A implements a protocol thus foo() should not be seen as part of the protocol at all.

So far, I have always extended a class when adding protocol compliance. I.e. it is always clear

I.e.

protocol P {
func foo()
}

class A {
fun foo() {} // Should not be regarded as implementation of P
}

extension A: P {
func foo() {} // This is the implementation of P
}

>
> On 22 Sep 2016, at 11:28, Martin Waitz via swift-evolution <swift-evolution@swift.org> wrote:
>
> Hi,
>
> isn't it perfectly fine to conform to multiple unrelated protocols which both require the same member?
> Or to declare protocol conformance in some unrelated module?
>
> Am 2016-09-22 07:15, schrieb Karl via swift-evolution:
>> I would like to make it a requirement if not inside a protocol
>> extension which declares a conformance, and actually build the
>> protocol name in to the member in an ABI-breaking way.
>
> IMO, this is much too restrictive.
> When we force the protocol name into the member, we make it impossible to conform to multiple protocols.
> Well ok, we could create alias names for all protocols.
> But often you don't know which protocols to conform to when you compile your module!
>
> What about:
>
> -- module A --
> class A {
> func foo() {}
> }
>
> -- module B --
> protocol Foo {
> func foo()
> }
> extension A: Foo {}
>
> What is your ABI name for A.foo()?
>
> Let's keep it simple!
> If a simple warning about unrelated methods in a protocol conformance extension solves 95% of our problem,
> then we shouldn't overengineer and throw away all our flexibility just to be 100% explicit about which protocol uses which members.
>
> --
> Martin
> _______________________________________________
> swift-evolution mailing list
> swift-evolution@swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

I'd also say that one or two keywords are superior than the protocol naming
approach in terms of implementation simplicity (for the core team).

My suggestions:

Either "conform" or "implement" should be a required keyword for all
properties/functions which implement a protocol (also in protocol extensions)

"override" should be used if a default implementation or a member of a
superclass is overridden.

Maximilian, again, you *do not know* if the conformed protocol, that has no default implementations *at the moment of your code writing* will or will not have default implementations at the *moment of compilation*.
Consider this scenario:

Step 1. You got 3rd party source file for your project, and you don't want/have no rights to change it, probably it is shared source used also in other projects, that code contains:

protocol A { func foo() }

class B : A {
  conform func foo() {...}
}

all is OK with this code, no default implementation, B.foo marked with `conform`.

Step 2. In your project in some of your files you decided to add default implementation of protocol A:

extension A {
  implement func foo() {...}
}

Now, your project will not compile - B.foo() must me marked with 'override' as protocol `A` has default implementation of foo().
If you change `conform` to `override` in 3rd party source file, it will not compile in some other project where no default implementation defined for `A` protocol.

That is *why* I believe the `override` as requirement as marker for protocol implementation method/prop is the best solution. See, in case `override` will be required, the initial source file will be like this:

protocol A { func foo() }

class B : A {
  override func foo() {...} // implementation
}

and it will compile ok : if A has default implementation and if A has no default implementation.

So, after you added default implementation in your project - no changes should be made to that 3rd party source file.

···

On 23.09.2016 11:05, Maximilian Hünenberger wrote:

If you are overriding a default implementation of a protocol "conform" /
"implement" is also required.

// Retroactive conformance (old behavior) but only in extensions
extension Foo: @retroactive Baz {
    // only some members of Baz are implemented here (they need the keywords)
    // the other members outside the extension don't need any additional
keywords
    // note: you can use "@retroactive" and "conform" in conjunction
}

*Future directions:*
"conform(ProtocolName)" / "override(ProtocolName)" can be used to disambiguate.

// reducing boilerplate
extension Foo: conform Bar {
    // These declarations can only implement Bar and don't need the
"conform" keyword
}

*Final question:*
Should we also require a marker for implemented protocol members in the
interface?:

protocol Foo {
    defaulted func foo()
}
extension Foo {
    implement func foo()
}

Best regards
Maximilian

Am 22.09.2016 um 16:44 schrieb Vladimir.S via swift-evolution
<swift-evolution@swift.org <mailto:swift-evolution@swift.org>>:

On 22.09.2016 11:10, Jean-Denis Muys via swift-evolution wrote:

I watched this thread with a lot of attention, starting neutral. You
must say that Karl won me over. His proposal would make Swift more
expressive, and less error prone in cases of protocol conformance with
name collisions. I am at this point +1

Actually I also support Karl's suggestion in general. It is trying to
solve IMO important problems and make Swift's protocol programming safer
and less fragile. Also it adds new interested features for working with
protocols.

But in reality, I don't feel like his suggestion could be accepted by
core team and community and even if it could be supported, it seems for
me that *implementation* of his proposal requires a huge amount of time
and big changes in how Swift is working currently. (Probably some one who
knows Swift internals could comment regarding this)
So, theoretically we'd have these improvements not in near future and I
think the problem discussed is very important to be addressed in Swift as
soon as possible.
I base my opinion also on previous discussions regarding similar subjects.

My suggestion regarding a marker for protocol implementation method/prop
in type - solves most of the addressed problems with protocol conformance
and with fragile of such conformance, and adds one new keyword (or even
zero - right now I think the `override` is better choice for such
"marker"). I believe this proposal could be implemented with much less
amount of work and with less changes to current internals of Swift and to
current code base, and so we can have such a big improvement in Swift
soon. So my intention was to suggest solution that can dramatically
improve Swift's protocol programming with "small" amount of changes for
compiler(internals) and for existed sources.

But it seems like the direction chosen by the core team and supported by
many in community - is just a warning if extension conforming type to
protocol contains unrelated to that protocol methods/props. I see that
this solution can improve protocol programming in some areas, but does
not address some IMO important issues we discussed in the thread :

* Currently extension can not have stored properties. So, if we want to
implement protocol's props as stored properties - we can't move them to
extension. So to implement this soulution - we need stored properties in
extensions. It is not clear if and when they are expected.

* This solution will not require the safety(regarding protocol
conformance) from a developer, it will only inform and only if protocol
conformance defined in extension. So, when you use 3rd party source code
- your project will not be protected for the discussed problems.

* To write safe code I can't group methods/props as I want, I have to
declare a number of extensions per-protocol (in case my type conforms to
a number of protocols)

* This solution does not solve problem of near-miss signature of method
definition in protocol extension like here:
protocol A { func foo() }
protocol B : A {}
extension A { func foo() }
extension B { func voo() } // typo. how to "mark" this should be impl?
"my" suggestion:
extension A { override func foo() }
extension B { override func foo() }

* Not clear how to write safe code with that approach if we implement
protocol requirement in derived class, but conformance was declared in
base (but not implemented) :
protocol P { func foo() }
extension P { func foo() }
class A : P {}
class B { func foo() } // we can't move this to extension, B already
conforms to P
, and in opposite to "my" `override` requirement for implementation, if
`A` will add its own foo() implementation - we'll have to change B's
definition(need to add `override` for B.foo )
"my" suggestion:
class B { override func foo() }

Jean-Denis

Sent from my iPhone

On 22 Sep 2016, at 07:15, Karl via swift-evolution >>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I would like to make it a requirement if not inside a protocol
extension which declares a conformance, and actually build the
protocol name in to the member in an ABI-breaking way. We could make
it additive by generating forwarding thunks from the old symbols to
the new ones, but it would be better if we could just solve the
overlapping-members problem before then.

That would mean you never get collisions between protocol members.
There’s loads of amazing stuff we can do with that ability, and ways
we can extend it to reduce a lot of boilerplate that occurs when you
want to have multiple representations of the same data (String is just
an example).

I don’t really care about the syntax we need to make it liveable. We
could automatically insert the protocol names for unambiguous members
at call-site, or something else.

This thread was originally about making the *syntax* a requirement; I
agree with that, and I would actually take it one (or several) steps
further, solving other problems along the way.

On 22 Sep 2016, at 06:46, Russ Bishop <xenadu@gmail.com >>>>> <mailto:xenadu@gmail.com>> wrote:

On Sep 20, 2016, at 4:34 PM, Dave Abrahams via swift-evolution >>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

on Tue Sep 20 2016, Karl <razielim-AT-gmail.com >>>>>>> <http://razielim-AT-gmail.com>> wrote:

I think the best way is to prefix the member name with the
protocol, e.g:

protocol MyProto { var aVariable : Int func aFunction() } class
MyClass : MyProto { var MyProto.aVariable : Int func
MyProto.aFunction() { … } }

...

CC-ing Dave A, to understand better if this fits with the vision
of protocols

I generally agree with Doug. The canonical way to indicate “this
method/property/type implements a requirement of protocol P”
should be to define the entity in an extension that also adds
conformance to P. If that's inadequate indication in some way we
should find a way to enhance it. I wouldn't mind the notation
above, but only as a fallback, not a reuquirement.

-- -Dave _______________________________________________

Indeed this is exactly how C# handles Interfaces (protocols). The
default is the exact same way Swift works - by matching names. If
there is a collision you specify Protocol.memberName. Its simple and
in the years I was writing C# code it was flexible enough to cover
most reasonable scenarios, without adding a bunch of boilerplate.

Russ

_______________________________________________ swift-evolution
mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________ swift-evolution mailing
list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

Well it just doesn't help with collisions it helps with signature changes
in a protocol going missed in conformers in a much more reliable way.

···

On Tue, Sep 27, 2016 at 8:11 AM Martin Waitz via swift-evolution < swift-evolution@swift.org> wrote:

Hi,

Am 2016-09-27 16:51, schrieb Dave Abrahams via swift-evolution:
> The cases where you find these kinds of exact collisions are so rare
> (never in my career) that it's fine if some manual work is needed.

I agree that such accidental collisions are quite rare (especially with
the Swift way of naming methods which makes it quite easy to describe
the semantics of the function).

However, I draw some other conclusion from it: I don't see why I should
have to explicitly name the protocol in my methods. The method name is
enough already to match it to the protocol.

We shouldn't complicate our language just for obscure cases where
protocols accidentally collide.

--
Martin
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Hi again,

···

Am 2016-09-27 16:51, schrieb Dave Abrahams via swift-evolution:

The cases where you find these kinds of exact collisions are so rare
(never in my career) that it's fine if some manual work is needed.

I agree that such accidental collisions are quite rare (especially
with the Swift way of naming methods which makes it quite easy to
describe the semantics of the function).

oh, sorry, I misread your statement.

--
Martin

Hi,

The cases where you find these kinds of exact collisions are so rare
(never in my career) that it's fine if some manual work is needed.

I agree that such accidental collisions are quite rare (especially
with the Swift way of naming methods which makes it quite easy to
describe the semantics of the function).

However, I draw some other conclusion from it: I don't see why I
should have to explicitly name the protocol in my methods. The method
name is enough already to match it to the protocol.

I draw the same conclusion. It should maybe be available as a backdoor
mechanism for handling those rare cases, but not a requirement.

···

on Tue Sep 27 2016, Martin Waitz <tali-AT-admingilde.org> wrote:

Am 2016-09-27 16:51, schrieb Dave Abrahams via swift-evolution:

We shouldn't complicate our language just for obscure cases where
protocols accidentally collide.

--
-Dave

Note: Second attempt, first mail was rejected ?

That is correct Vladimir, at the point of writing an API you never know who will end up using it in which way.
Hence the decision which flavour (of a function) to call should not be made by the coder writing the API but by the coder using the API.
And that coder cannot claim not to know which flavour he wants.
Hence including the ‘override’ keyword is unnecessary. However having the ability to specifying which flavour must be called is necessary. And this ability is easy to accommodate within the current language rules. (casting or possibly having a dot-notation for this purpose)

Regards,
Rien.

···

On 23 Sep 2016, at 12:47, Vladimir.S via swift-evolution <swift-evolution@swift.org> wrote:

On 23.09.2016 11:05, Maximilian Hünenberger wrote:

I'd also say that one or two keywords are superior than the protocol naming
approach in terms of implementation simplicity (for the core team).

My suggestions:

Either "conform" or "implement" should be a required keyword for all
properties/functions which implement a protocol (also in protocol extensions)

"override" should be used if a default implementation or a member of a
superclass is overridden.

Maximilian, again, you *do not know* if the conformed protocol, that has no default implementations *at the moment of your code writing* will or will not have default implementations at the *moment of compilation*.
Consider this scenario:

Step 1. You got 3rd party source file for your project, and you don't want/have no rights to change it, probably it is shared source used also in other projects, that code contains:

protocol A { func foo() }

class B : A {
  conform func foo() {...}
}

all is OK with this code, no default implementation, B.foo marked with `conform`.

Step 2. In your project in some of your files you decided to add default implementation of protocol A:

extension A {
  implement func foo() {...}
}

Now, your project will not compile - B.foo() must me marked with 'override' as protocol `A` has default implementation of foo().
If you change `conform` to `override` in 3rd party source file, it will not compile in some other project where no default implementation defined for `A` protocol.

That is *why* I believe the `override` as requirement as marker for protocol implementation method/prop is the best solution. See, in case `override` will be required, the initial source file will be like this:

protocol A { func foo() }

class B : A {
  override func foo() {...} // implementation
}

and it will compile ok : if A has default implementation and if A has no default implementation.

So, after you added default implementation in your project - no changes should be made to that 3rd party source file.

If you are overriding a default implementation of a protocol "conform" /
"implement" is also required.

// Retroactive conformance (old behavior) but only in extensions
extension Foo: @retroactive Baz {
   // only some members of Baz are implemented here (they need the keywords)
   // the other members outside the extension don't need any additional
keywords
   // note: you can use "@retroactive" and "conform" in conjunction
}

*Future directions:*
"conform(ProtocolName)" / "override(ProtocolName)" can be used to disambiguate.

// reducing boilerplate
extension Foo: conform Bar {
   // These declarations can only implement Bar and don't need the
"conform" keyword
}

*Final question:*
Should we also require a marker for implemented protocol members in the
interface?:

protocol Foo {
   defaulted func foo()
}
extension Foo {
   implement func foo()
}

Best regards
Maximilian

Am 22.09.2016 um 16:44 schrieb Vladimir.S via swift-evolution
<swift-evolution@swift.org <mailto:swift-evolution@swift.org>>:

On 22.09.2016 11:10, Jean-Denis Muys via swift-evolution wrote:

I watched this thread with a lot of attention, starting neutral. You
must say that Karl won me over. His proposal would make Swift more
expressive, and less error prone in cases of protocol conformance with
name collisions. I am at this point +1

Actually I also support Karl's suggestion in general. It is trying to
solve IMO important problems and make Swift's protocol programming safer
and less fragile. Also it adds new interested features for working with
protocols.

But in reality, I don't feel like his suggestion could be accepted by
core team and community and even if it could be supported, it seems for
me that *implementation* of his proposal requires a huge amount of time
and big changes in how Swift is working currently. (Probably some one who
knows Swift internals could comment regarding this)
So, theoretically we'd have these improvements not in near future and I
think the problem discussed is very important to be addressed in Swift as
soon as possible.
I base my opinion also on previous discussions regarding similar subjects.

My suggestion regarding a marker for protocol implementation method/prop
in type - solves most of the addressed problems with protocol conformance
and with fragile of such conformance, and adds one new keyword (or even
zero - right now I think the `override` is better choice for such
"marker"). I believe this proposal could be implemented with much less
amount of work and with less changes to current internals of Swift and to
current code base, and so we can have such a big improvement in Swift
soon. So my intention was to suggest solution that can dramatically
improve Swift's protocol programming with "small" amount of changes for
compiler(internals) and for existed sources.

But it seems like the direction chosen by the core team and supported by
many in community - is just a warning if extension conforming type to
protocol contains unrelated to that protocol methods/props. I see that
this solution can improve protocol programming in some areas, but does
not address some IMO important issues we discussed in the thread :

* Currently extension can not have stored properties. So, if we want to
implement protocol's props as stored properties - we can't move them to
extension. So to implement this soulution - we need stored properties in
extensions. It is not clear if and when they are expected.

* This solution will not require the safety(regarding protocol
conformance) from a developer, it will only inform and only if protocol
conformance defined in extension. So, when you use 3rd party source code
- your project will not be protected for the discussed problems.

* To write safe code I can't group methods/props as I want, I have to
declare a number of extensions per-protocol (in case my type conforms to
a number of protocols)

* This solution does not solve problem of near-miss signature of method
definition in protocol extension like here:
protocol A { func foo() }
protocol B : A {}
extension A { func foo() }
extension B { func voo() } // typo. how to "mark" this should be impl?
"my" suggestion:
extension A { override func foo() }
extension B { override func foo() }

* Not clear how to write safe code with that approach if we implement
protocol requirement in derived class, but conformance was declared in
base (but not implemented) :
protocol P { func foo() }
extension P { func foo() }
class A : P {}
class B { func foo() } // we can't move this to extension, B already
conforms to P
, and in opposite to "my" `override` requirement for implementation, if
`A` will add its own foo() implementation - we'll have to change B's
definition(need to add `override` for B.foo )
"my" suggestion:
class B { override func foo() }

Jean-Denis

Sent from my iPhone

On 22 Sep 2016, at 07:15, Karl via swift-evolution >>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I would like to make it a requirement if not inside a protocol
extension which declares a conformance, and actually build the
protocol name in to the member in an ABI-breaking way. We could make
it additive by generating forwarding thunks from the old symbols to
the new ones, but it would be better if we could just solve the
overlapping-members problem before then.

That would mean you never get collisions between protocol members.
There’s loads of amazing stuff we can do with that ability, and ways
we can extend it to reduce a lot of boilerplate that occurs when you
want to have multiple representations of the same data (String is just
an example).

I don’t really care about the syntax we need to make it liveable. We
could automatically insert the protocol names for unambiguous members
at call-site, or something else.

This thread was originally about making the *syntax* a requirement; I
agree with that, and I would actually take it one (or several) steps
further, solving other problems along the way.

On 22 Sep 2016, at 06:46, Russ Bishop <xenadu@gmail.com >>>>>> <mailto:xenadu@gmail.com>> wrote:

On Sep 20, 2016, at 4:34 PM, Dave Abrahams via swift-evolution >>>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

on Tue Sep 20 2016, Karl <razielim-AT-gmail.com >>>>>>>> <http://razielim-AT-gmail.com>> wrote:

I think the best way is to prefix the member name with the
protocol, e.g:

protocol MyProto { var aVariable : Int func aFunction() } class
MyClass : MyProto { var MyProto.aVariable : Int func
MyProto.aFunction() { … } }

...

CC-ing Dave A, to understand better if this fits with the vision
of protocols

I generally agree with Doug. The canonical way to indicate “this
method/property/type implements a requirement of protocol P”
should be to define the entity in an extension that also adds
conformance to P. If that's inadequate indication in some way we
should find a way to enhance it. I wouldn't mind the notation
above, but only as a fallback, not a reuquirement.

-- -Dave _______________________________________________

Indeed this is exactly how C# handles Interfaces (protocols). The
default is the exact same way Swift works - by matching names. If
there is a collision you specify Protocol.memberName. Its simple and
in the years I was writing C# code it was flexible enough to cover
most reasonable scenarios, without adding a bunch of boilerplate.

Russ

_______________________________________________ swift-evolution
mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________ swift-evolution mailing
list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Hello :)

> -- module A --
> class A {
> func foo() {}
> }
>
> -- module B --
> protocol Foo {
> func foo()
> }
> extension A: Foo {}

let c = A()

I’d say that you have two functions here:
A.foo() and A.Foo.foo()

No. Now (i.e. within module B) A conforms to Foo, using the already existing function.

Note that A.foo() was never intended to be used as an implementation
for protocol Foo, thus why should you be able to see it as such? That
imo is a bug in the language. Its not flexibility, it’s dangerous.

I disagree, this is the great thing about Swift.
It's exactly in the middle between Go's "everything is considered to implement a protocol if it happens to provide the right methods" and C++/younameit's "you have to know everything in advance and people are screwed if the library does not use the right protocols" style.

You can add protocol conformance to classes you don't control, but you have to explicitly declare this conformance.
I think this is exactly the right approach.

···

Am 2016-09-23 08:50, schrieb Rien:

--
Martin

I'd also say that one or two keywords are superior than the protocol naming
approach in terms of implementation simplicity (for the core team).

My suggestions:

Either "conform" or "implement" should be a required keyword for all
properties/functions which implement a protocol (also in protocol extensions)

"override" should be used if a default implementation or a member of a
superclass is overridden.

Maximilian, again, you *do not know* if the conformed protocol, that has no default implementations *at the moment of your code writing* will or will not have default implementations at the *moment of compilation*.
Consider this scenario:

Step 1. You got 3rd party source file for your project, and you don't want/have no rights to change it, probably it is shared source used also in other projects, that code contains:

protocol A { func foo() }

class B : A {
   conform func foo() {...}
}

all is OK with this code, no default implementation, B.foo marked with `conform`.

Step 2. In your project in some of your files you decided to add default implementation of protocol A:

extension A {
   implement func foo() {...}
}

Now, your project will not compile - B.foo() must me marked with 'override' as protocol `A` has default implementation of foo().
If you change `conform` to `override` in 3rd party source file, it will not compile in some other project where no default implementation defined for `A` protocol.

That is *why* I believe the `override` as requirement as marker for protocol implementation method/prop is the best solution. See, in case `override` will be required, the initial source file will be like this:

protocol A { func foo() }

class B : A {
   override func foo() {...} // implementation
}

and it will compile ok : if A has default implementation and if A has no default implementation.

So, after you added default implementation in your project - no changes should be made to that 3rd party source file.

In case of my suggestion this is an easy fix: `override` is not required if it overrides a member of an extension in another module.

My basic idea is to distinguish between implementation and (true) overriding (of other members. Do you agree?

Consider this:

protocol A1 {
    func foo()
}

extension A1 {
    implement func foo() {}
}

protocol A2: A1 {
    override func foo() {}
}

In this case you know that `foo` in extension A1 does not override any other method.

Best regards
Maximilian

···

Am 23.09.2016 um 12:47 schrieb Vladimir.S <svabox@gmail.com>:

On 23.09.2016 11:05, Maximilian Hünenberger wrote:

If you are overriding a default implementation of a protocol "conform" /
"implement" is also required.

// Retroactive conformance (old behavior) but only in extensions
extension Foo: @retroactive Baz {
   // only some members of Baz are implemented here (they need the keywords)
   // the other members outside the extension don't need any additional
keywords
   // note: you can use "@retroactive" and "conform" in conjunction
}

*Future directions:*
"conform(ProtocolName)" / "override(ProtocolName)" can be used to disambiguate.

// reducing boilerplate
extension Foo: conform Bar {
   // These declarations can only implement Bar and don't need the
"conform" keyword
}

*Final question:*
Should we also require a marker for implemented protocol members in the
interface?:

protocol Foo {
   defaulted func foo()
}
extension Foo {
   implement func foo()
}

Best regards
Maximilian

Note: Second attempt, first mail was rejected ?

That is correct Vladimir, at the point of writing an API you never know who will end up using it in which way.
Hence the decision which flavour (of a function) to call should not be made by the coder writing the API but by the coder using the API.
And that coder cannot claim not to know which flavour he wants.
Hence including the ‘override’ keyword is unnecessary. However having the ability to specifying which flavour must be called is necessary. And this ability is easy to accommodate within the current language rules. (casting or possibly having a dot-notation for this purpose)

Sorry, I'm not sure I fully understand.. I replied to Maximilian's suggestion to use `conform` keyword if there is no default implementation for implemented protocol requirement and use `override` if there is such default implementation for the requirement. So, I show that we can't accept such solution as it leads to such kind of dependency when some other's code depends on your local code. I.e. if you add default implementations for protocol defined in 3rd party code - you can break compilation of that code and this should not happen(see my example in previous message).

As for requirement for any keyword to mark protocol implementation method/prop in type - there were a lot of description in the thread why we need this and what kind of problem this could solve and prevent hard-to-find bugs. Also please look into initial problem of this thread.

···

On 23.09.2016 15:10, Rien wrote:

Regards,
Rien.

On 23 Sep 2016, at 12:47, Vladimir.S via swift-evolution <swift-evolution@swift.org> wrote:

On 23.09.2016 11:05, Maximilian Hünenberger wrote:

I'd also say that one or two keywords are superior than the protocol naming
approach in terms of implementation simplicity (for the core team).

My suggestions:

Either "conform" or "implement" should be a required keyword for all
properties/functions which implement a protocol (also in protocol extensions)

"override" should be used if a default implementation or a member of a
superclass is overridden.

Maximilian, again, you *do not know* if the conformed protocol, that has no default implementations *at the moment of your code writing* will or will not have default implementations at the *moment of compilation*.
Consider this scenario:

Step 1. You got 3rd party source file for your project, and you don't want/have no rights to change it, probably it is shared source used also in other projects, that code contains:

protocol A { func foo() }

class B : A {
  conform func foo() {...}
}

all is OK with this code, no default implementation, B.foo marked with `conform`.

Step 2. In your project in some of your files you decided to add default implementation of protocol A:

extension A {
  implement func foo() {...}
}

Now, your project will not compile - B.foo() must me marked with 'override' as protocol `A` has default implementation of foo().
If you change `conform` to `override` in 3rd party source file, it will not compile in some other project where no default implementation defined for `A` protocol.

That is *why* I believe the `override` as requirement as marker for protocol implementation method/prop is the best solution. See, in case `override` will be required, the initial source file will be like this:

protocol A { func foo() }

class B : A {
  override func foo() {...} // implementation
}

and it will compile ok : if A has default implementation and if A has no default implementation.

So, after you added default implementation in your project - no changes should be made to that 3rd party source file.

If you are overriding a default implementation of a protocol "conform" /
"implement" is also required.

// Retroactive conformance (old behavior) but only in extensions
extension Foo: @retroactive Baz {
   // only some members of Baz are implemented here (they need the keywords)
   // the other members outside the extension don't need any additional
keywords
   // note: you can use "@retroactive" and "conform" in conjunction
}

*Future directions:*
"conform(ProtocolName)" / "override(ProtocolName)" can be used to disambiguate.

// reducing boilerplate
extension Foo: conform Bar {
   // These declarations can only implement Bar and don't need the
"conform" keyword
}

*Final question:*
Should we also require a marker for implemented protocol members in the
interface?:

protocol Foo {
   defaulted func foo()
}
extension Foo {
   implement func foo()
}

Best regards
Maximilian

Am 22.09.2016 um 16:44 schrieb Vladimir.S via swift-evolution
<swift-evolution@swift.org <mailto:swift-evolution@swift.org>>:

On 22.09.2016 11:10, Jean-Denis Muys via swift-evolution wrote:

I watched this thread with a lot of attention, starting neutral. You
must say that Karl won me over. His proposal would make Swift more
expressive, and less error prone in cases of protocol conformance with
name collisions. I am at this point +1

Actually I also support Karl's suggestion in general. It is trying to
solve IMO important problems and make Swift's protocol programming safer
and less fragile. Also it adds new interested features for working with
protocols.

But in reality, I don't feel like his suggestion could be accepted by
core team and community and even if it could be supported, it seems for
me that *implementation* of his proposal requires a huge amount of time
and big changes in how Swift is working currently. (Probably some one who
knows Swift internals could comment regarding this)
So, theoretically we'd have these improvements not in near future and I
think the problem discussed is very important to be addressed in Swift as
soon as possible.
I base my opinion also on previous discussions regarding similar subjects.

My suggestion regarding a marker for protocol implementation method/prop
in type - solves most of the addressed problems with protocol conformance
and with fragile of such conformance, and adds one new keyword (or even
zero - right now I think the `override` is better choice for such
"marker"). I believe this proposal could be implemented with much less
amount of work and with less changes to current internals of Swift and to
current code base, and so we can have such a big improvement in Swift
soon. So my intention was to suggest solution that can dramatically
improve Swift's protocol programming with "small" amount of changes for
compiler(internals) and for existed sources.

But it seems like the direction chosen by the core team and supported by
many in community - is just a warning if extension conforming type to
protocol contains unrelated to that protocol methods/props. I see that
this solution can improve protocol programming in some areas, but does
not address some IMO important issues we discussed in the thread :

* Currently extension can not have stored properties. So, if we want to
implement protocol's props as stored properties - we can't move them to
extension. So to implement this soulution - we need stored properties in
extensions. It is not clear if and when they are expected.

* This solution will not require the safety(regarding protocol
conformance) from a developer, it will only inform and only if protocol
conformance defined in extension. So, when you use 3rd party source code
- your project will not be protected for the discussed problems.

* To write safe code I can't group methods/props as I want, I have to
declare a number of extensions per-protocol (in case my type conforms to
a number of protocols)

* This solution does not solve problem of near-miss signature of method
definition in protocol extension like here:
protocol A { func foo() }
protocol B : A {}
extension A { func foo() }
extension B { func voo() } // typo. how to "mark" this should be impl?
"my" suggestion:
extension A { override func foo() }
extension B { override func foo() }

* Not clear how to write safe code with that approach if we implement
protocol requirement in derived class, but conformance was declared in
base (but not implemented) :
protocol P { func foo() }
extension P { func foo() }
class A : P {}
class B { func foo() } // we can't move this to extension, B already
conforms to P
, and in opposite to "my" `override` requirement for implementation, if
`A` will add its own foo() implementation - we'll have to change B's
definition(need to add `override` for B.foo )
"my" suggestion:
class B { override func foo() }

Jean-Denis

Sent from my iPhone

On 22 Sep 2016, at 07:15, Karl via swift-evolution >>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I would like to make it a requirement if not inside a protocol
extension which declares a conformance, and actually build the
protocol name in to the member in an ABI-breaking way. We could make
it additive by generating forwarding thunks from the old symbols to
the new ones, but it would be better if we could just solve the
overlapping-members problem before then.

That would mean you never get collisions between protocol members.
There’s loads of amazing stuff we can do with that ability, and ways
we can extend it to reduce a lot of boilerplate that occurs when you
want to have multiple representations of the same data (String is just
an example).

I don’t really care about the syntax we need to make it liveable. We
could automatically insert the protocol names for unambiguous members
at call-site, or something else.

This thread was originally about making the *syntax* a requirement; I
agree with that, and I would actually take it one (or several) steps
further, solving other problems along the way.

On 22 Sep 2016, at 06:46, Russ Bishop <xenadu@gmail.com >>>>>>> <mailto:xenadu@gmail.com>> wrote:

On Sep 20, 2016, at 4:34 PM, Dave Abrahams via swift-evolution >>>>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

on Tue Sep 20 2016, Karl <razielim-AT-gmail.com >>>>>>>>> <http://razielim-AT-gmail.com>> wrote:

I think the best way is to prefix the member name with the
protocol, e.g:

protocol MyProto { var aVariable : Int func aFunction() } class
MyClass : MyProto { var MyProto.aVariable : Int func
MyProto.aFunction() { … } }

...

CC-ing Dave A, to understand better if this fits with the vision
of protocols

I generally agree with Doug. The canonical way to indicate “this
method/property/type implements a requirement of protocol P”
should be to define the entity in an extension that also adds
conformance to P. If that's inadequate indication in some way we
should find a way to enhance it. I wouldn't mind the notation
above, but only as a fallback, not a reuquirement.

-- -Dave _______________________________________________

Indeed this is exactly how C# handles Interfaces (protocols). The
default is the exact same way Swift works - by matching names. If
there is a collision you specify Protocol.memberName. Its simple and
in the years I was writing C# code it was flexible enough to cover
most reasonable scenarios, without adding a bunch of boilerplate.

Russ

_______________________________________________ swift-evolution
mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________ swift-evolution mailing
list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Hello Martin,

Adding protocol conformance via existing functions can be had in different ways, first it could be done via mapping rules.
I.e. if the API user requests a function A.Foo.foo() and there is only a function A.foo() present, the language rules could allow this to be accepted as the default. This is probably the best option if the impact on existing code should be minimized.

Another way would be to use a little boilerplate and provide a new A.Foo.foo() that calls A.foo(). Not very nice, but it does make the intent very clear.

A third way would be to write something like:

extension A: Foo {
func foo() use A.foo()
}

but that is adding an extra keyword, which I think needs to be very carefully considered. I would not suggest it right now.

MfG,
Rien.

···

On 23 Sep 2016, at 14:58, Martin Waitz <tali@admingilde.org> wrote:

Hello :)

Am 2016-09-23 08:50, schrieb Rien:

> -- module A --
> class A {
> func foo() {}
> }
>
> -- module B --
> protocol Foo {
> func foo()
> }
> extension A: Foo {}
let c = A()
I’d say that you have two functions here:
A.foo() and A.Foo.foo()

No. Now (i.e. within module B) A conforms to Foo, using the already existing function.

Note that A.foo() was never intended to be used as an implementation
for protocol Foo, thus why should you be able to see it as such? That
imo is a bug in the language. Its not flexibility, it’s dangerous.

I disagree, this is the great thing about Swift.
It's exactly in the middle between Go's "everything is considered to implement a protocol if it happens to provide the right methods" and C++/younameit's "you have to know everything in advance and people are screwed if the library does not use the right protocols" style.

You can add protocol conformance to classes you don't control, but you have to explicitly declare this conformance.
I think this is exactly the right approach.

--
Martin

Hello Vladimir,

Going back to the original suggestion:

4.1 Different implementation for different protocols
class Foo : ProtocolA, ProtocolB {
   implement(ProtocolA) func foo() {...}
   implement(ProtocolB) func foo() {...}
}
class Foo : ProtocolA, ProtocolB {
   implement ProtocolA {
    func foo() {...}
   }
   implement ProtocolB {
    func foo() {...}
   }
}

I would rather solve this by implementing the conformance of Foo to either protocol in its own extension:

class Foo {}

extension Foo: ProtocolA {
func foo()
}

extension Foo: ProtocolB {
func foo()
}

This way the extra keyword is not necessary.
However it does make it necessary to be able to select the exact foo() an API user would want.
The API user has that knowledge and can select if via: (Foo as! ProtocolA).foo()

Or via a convenience dot-contruction: Foo.ProtocolA.foo()

I think that my suggestion may be more work, but it feels to me as if it is more in line with the general swift-phylosophy.

Regards,
Rien.

···

On 23 Sep 2016, at 15:08, Vladimir.S <svabox@gmail.com> wrote:

On 23.09.2016 15:10, Rien wrote:

Note: Second attempt, first mail was rejected ?

That is correct Vladimir, at the point of writing an API you never know who will end up using it in which way.
Hence the decision which flavour (of a function) to call should not be made by the coder writing the API but by the coder using the API.
And that coder cannot claim not to know which flavour he wants.
Hence including the ‘override’ keyword is unnecessary. However having the ability to specifying which flavour must be called is necessary. And this ability is easy to accommodate within the current language rules. (casting or possibly having a dot-notation for this purpose)

Sorry, I'm not sure I fully understand.. I replied to Maximilian's suggestion to use `conform` keyword if there is no default implementation for implemented protocol requirement and use `override` if there is such default implementation for the requirement. So, I show that we can't accept such solution as it leads to such kind of dependency when some other's code depends on your local code. I.e. if you add default implementations for protocol defined in 3rd party code - you can break compilation of that code and this should not happen(see my example in previous message).

As for requirement for any keyword to mark protocol implementation method/prop in type - there were a lot of description in the thread why we need this and what kind of problem this could solve and prevent hard-to-find bugs. Also please look into initial problem of this thread.

Regards,
Rien.

On 23 Sep 2016, at 12:47, Vladimir.S via swift-evolution <swift-evolution@swift.org> wrote:

On 23.09.2016 11:05, Maximilian Hünenberger wrote:

I'd also say that one or two keywords are superior than the protocol naming
approach in terms of implementation simplicity (for the core team).

My suggestions:

Either "conform" or "implement" should be a required keyword for all
properties/functions which implement a protocol (also in protocol extensions)

"override" should be used if a default implementation or a member of a
superclass is overridden.

Maximilian, again, you *do not know* if the conformed protocol, that has no default implementations *at the moment of your code writing* will or will not have default implementations at the *moment of compilation*.
Consider this scenario:

Step 1. You got 3rd party source file for your project, and you don't want/have no rights to change it, probably it is shared source used also in other projects, that code contains:

protocol A { func foo() }

class B : A {
  conform func foo() {...}
}

all is OK with this code, no default implementation, B.foo marked with `conform`.

Step 2. In your project in some of your files you decided to add default implementation of protocol A:

extension A {
  implement func foo() {...}
}

Now, your project will not compile - B.foo() must me marked with 'override' as protocol `A` has default implementation of foo().
If you change `conform` to `override` in 3rd party source file, it will not compile in some other project where no default implementation defined for `A` protocol.

That is *why* I believe the `override` as requirement as marker for protocol implementation method/prop is the best solution. See, in case `override` will be required, the initial source file will be like this:

protocol A { func foo() }

class B : A {
  override func foo() {...} // implementation
}

and it will compile ok : if A has default implementation and if A has no default implementation.

So, after you added default implementation in your project - no changes should be made to that 3rd party source file.

If you are overriding a default implementation of a protocol "conform" /
"implement" is also required.

// Retroactive conformance (old behavior) but only in extensions
extension Foo: @retroactive Baz {
  // only some members of Baz are implemented here (they need the keywords)
  // the other members outside the extension don't need any additional
keywords
  // note: you can use "@retroactive" and "conform" in conjunction
}

*Future directions:*
"conform(ProtocolName)" / "override(ProtocolName)" can be used to disambiguate.

// reducing boilerplate
extension Foo: conform Bar {
  // These declarations can only implement Bar and don't need the
"conform" keyword
}

*Final question:*
Should we also require a marker for implemented protocol members in the
interface?:

protocol Foo {
  defaulted func foo()
}
extension Foo {
  implement func foo()
}

Best regards
Maximilian

Am 22.09.2016 um 16:44 schrieb Vladimir.S via swift-evolution
<swift-evolution@swift.org <mailto:swift-evolution@swift.org>>:

On 22.09.2016 11:10, Jean-Denis Muys via swift-evolution wrote:

I watched this thread with a lot of attention, starting neutral. You
must say that Karl won me over. His proposal would make Swift more
expressive, and less error prone in cases of protocol conformance with
name collisions. I am at this point +1

Actually I also support Karl's suggestion in general. It is trying to
solve IMO important problems and make Swift's protocol programming safer
and less fragile. Also it adds new interested features for working with
protocols.

But in reality, I don't feel like his suggestion could be accepted by
core team and community and even if it could be supported, it seems for
me that *implementation* of his proposal requires a huge amount of time
and big changes in how Swift is working currently. (Probably some one who
knows Swift internals could comment regarding this)
So, theoretically we'd have these improvements not in near future and I
think the problem discussed is very important to be addressed in Swift as
soon as possible.
I base my opinion also on previous discussions regarding similar subjects.

My suggestion regarding a marker for protocol implementation method/prop
in type - solves most of the addressed problems with protocol conformance
and with fragile of such conformance, and adds one new keyword (or even
zero - right now I think the `override` is better choice for such
"marker"). I believe this proposal could be implemented with much less
amount of work and with less changes to current internals of Swift and to
current code base, and so we can have such a big improvement in Swift
soon. So my intention was to suggest solution that can dramatically
improve Swift's protocol programming with "small" amount of changes for
compiler(internals) and for existed sources.

But it seems like the direction chosen by the core team and supported by
many in community - is just a warning if extension conforming type to
protocol contains unrelated to that protocol methods/props. I see that
this solution can improve protocol programming in some areas, but does
not address some IMO important issues we discussed in the thread :

* Currently extension can not have stored properties. So, if we want to
implement protocol's props as stored properties - we can't move them to
extension. So to implement this soulution - we need stored properties in
extensions. It is not clear if and when they are expected.

* This solution will not require the safety(regarding protocol
conformance) from a developer, it will only inform and only if protocol
conformance defined in extension. So, when you use 3rd party source code
- your project will not be protected for the discussed problems.

* To write safe code I can't group methods/props as I want, I have to
declare a number of extensions per-protocol (in case my type conforms to
a number of protocols)

* This solution does not solve problem of near-miss signature of method
definition in protocol extension like here:
protocol A { func foo() }
protocol B : A {}
extension A { func foo() }
extension B { func voo() } // typo. how to "mark" this should be impl?
"my" suggestion:
extension A { override func foo() }
extension B { override func foo() }

* Not clear how to write safe code with that approach if we implement
protocol requirement in derived class, but conformance was declared in
base (but not implemented) :
protocol P { func foo() }
extension P { func foo() }
class A : P {}
class B { func foo() } // we can't move this to extension, B already
conforms to P
, and in opposite to "my" `override` requirement for implementation, if
`A` will add its own foo() implementation - we'll have to change B's
definition(need to add `override` for B.foo )
"my" suggestion:
class B { override func foo() }

Jean-Denis

Sent from my iPhone

On 22 Sep 2016, at 07:15, Karl via swift-evolution >>>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

I would like to make it a requirement if not inside a protocol
extension which declares a conformance, and actually build the
protocol name in to the member in an ABI-breaking way. We could make
it additive by generating forwarding thunks from the old symbols to
the new ones, but it would be better if we could just solve the
overlapping-members problem before then.

That would mean you never get collisions between protocol members.
There’s loads of amazing stuff we can do with that ability, and ways
we can extend it to reduce a lot of boilerplate that occurs when you
want to have multiple representations of the same data (String is just
an example).

I don’t really care about the syntax we need to make it liveable. We
could automatically insert the protocol names for unambiguous members
at call-site, or something else.

This thread was originally about making the *syntax* a requirement; I
agree with that, and I would actually take it one (or several) steps
further, solving other problems along the way.

On 22 Sep 2016, at 06:46, Russ Bishop <xenadu@gmail.com >>>>>>>> <mailto:xenadu@gmail.com>> wrote:

On Sep 20, 2016, at 4:34 PM, Dave Abrahams via swift-evolution >>>>>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

on Tue Sep 20 2016, Karl <razielim-AT-gmail.com >>>>>>>>>> <http://razielim-AT-gmail.com>> wrote:

I think the best way is to prefix the member name with the
protocol, e.g:

protocol MyProto { var aVariable : Int func aFunction() } class
MyClass : MyProto { var MyProto.aVariable : Int func
MyProto.aFunction() { … } }

...

CC-ing Dave A, to understand better if this fits with the vision
of protocols

I generally agree with Doug. The canonical way to indicate “this
method/property/type implements a requirement of protocol P”
should be to define the entity in an extension that also adds
conformance to P. If that's inadequate indication in some way we
should find a way to enhance it. I wouldn't mind the notation
above, but only as a fallback, not a reuquirement.

-- -Dave _______________________________________________

Indeed this is exactly how C# handles Interfaces (protocols). The
default is the exact same way Swift works - by matching names. If
there is a collision you specify Protocol.memberName. Its simple and
in the years I was writing C# code it was flexible enough to cover
most reasonable scenarios, without adding a bunch of boilerplate.

Russ

_______________________________________________ swift-evolution
mailing list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________ swift-evolution mailing
list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Hello Vladimir,

Going back to the original suggestion:

/4.1 Different implementation for different protocols/
/class Foo : ProtocolA, ProtocolB {/
/ implement(ProtocolA) func foo() {...}/
/ implement(ProtocolB) func foo() {...}/
/}/
/class Foo : ProtocolA, ProtocolB {/
/ implement ProtocolA {/
/ func foo() {...}/
/ }/
/ implement ProtocolB {/
/ func foo() {...}/
/ }/
/}/

I would rather solve this by implementing the conformance of Foo to either
protocol in its own extension:

Yes, this solution also was discussed in one of last emails. More specifically, the solution where only warning will be raised and only if you conform to protocol in extension(if you conform "in-place" - no any additional feature to express your intention) was discussed.

Will repeat myself:

* Currently extension can not have stored properties. So, if we want to implement protocol's props as stored properties - we can't move them to extension. So to implement this soulution - we need stored properties in extensions. It is not clear if and when they are expected.

* This solution will not require the safety(regarding protocol conformance) from a developer, it will only inform and only if protocol conformance defined in extension. So, when you use 3rd party source code - your project will not be protected for the discussed problems.

* To write safe code I can't group methods/props as I want, I have to declare a number of extensions per-protocol (in case my type conforms to a number of protocols)

* This solution does not solve problem of near-miss signature of method definition in protocol extension like here:
protocol A { func foo() }
protocol B : A {}
extension A { func foo() }
extension B { func voo() } // typo. how to "mark" this should be impl?

* Not clear how to write safe code with that approach if we implement protocol requirement in derived class, but conformance was declared in base (but not implemented) :
protocol P { func foo() }
extension P { func foo() }
class A : P {}
class B { func foo() } // we can't move this to extension, B already conforms to P
, and in opposite to "my" `override` requirement for implementation, if `A` will add its own foo() implementation - we'll have to change B's definition(need to add `override` for B.foo )

If these questions could be addressed by the "conformance in extension" solution - then I also most likely will think it is the best solution. But right now I see that this solution will not help in many places where we need help from compiler to prevent hard-to-find bugs.

···

On 23.09.2016 17:41, Rien wrote:

class Foo {}

extension Foo: ProtocolA {
func foo()
}

extension Foo: ProtocolB {
func foo()
}

This way the extra keyword is not necessary.
However it does make it necessary to be able to select the exact foo() an
API user would want.
The API user has that knowledge and can select if via: (Foo as!
ProtocolA).foo()

Or via a convenience dot-contruction: Foo.ProtocolA.foo()

I think that my suggestion may be more work, but it feels to me as if it is
more in line with the general swift-phylosophy.

Regards,
Rien.

On 23 Sep 2016, at 15:08, Vladimir.S <svabox@gmail.com >> <mailto:svabox@gmail.com>> wrote:

On 23.09.2016 15:10, Rien wrote:

Note: Second attempt, first mail was rejected ?

That is correct Vladimir, at the point of writing an API you never know
who will end up using it in which way.
Hence the decision which flavour (of a function) to call should not be
made by the coder writing the API but by the coder using the API.
And that coder cannot claim not to know which flavour he wants.
Hence including the ‘override’ keyword is unnecessary. However having
the ability to specifying which flavour must be called is necessary. And
this ability is easy to accommodate within the current language rules.
(casting or possibly having a dot-notation for this purpose)

Sorry, I'm not sure I fully understand.. I replied to Maximilian's
suggestion to use `conform` keyword if there is no default implementation
for implemented protocol requirement and use `override` if there is such
default implementation for the requirement. So, I show that we can't
accept such solution as it leads to such kind of dependency when some
other's code depends on your local code. I.e. if you add default
implementations for protocol defined in 3rd party code - you can break
compilation of that code and this should not happen(see my example in
previous message).

As for requirement for any keyword to mark protocol implementation
method/prop in type - there were a lot of description in the thread why
we need this and what kind of problem this could solve and prevent
hard-to-find bugs. Also please look into initial problem of this thread.

Regards,
Rien.

On 23 Sep 2016, at 12:47, Vladimir.S via swift-evolution >>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

On 23.09.2016 11:05, Maximilian Hünenberger wrote:

I'd also say that one or two keywords are superior than the protocol
naming
approach in terms of implementation simplicity (for the core team).

My suggestions:

Either "conform" or "implement" should be a required keyword for all
properties/functions which implement a protocol (also in protocol
extensions)

"override" should be used if a default implementation or a member of a
superclass is overridden.

Maximilian, again, you *do not know* if the conformed protocol, that
has no default implementations *at the moment of your code writing*
will or will not have default implementations at the *moment of
compilation*.
Consider this scenario:

Step 1. You got 3rd party source file for your project, and you don't
want/have no rights to change it, probably it is shared source used
also in other projects, that code contains:

protocol A { func foo() }

class B : A {
conform func foo() {...}
}

all is OK with this code, no default implementation, B.foo marked with
`conform`.

Step 2. In your project in some of your files you decided to add
default implementation of protocol A:

extension A {
implement func foo() {...}
}

Now, your project will not compile - B.foo() must me marked with
'override' as protocol `A` has default implementation of foo().
If you change `conform` to `override` in 3rd party source file, it will
not compile in some other project where no default implementation
defined for `A` protocol.

That is *why* I believe the `override` as requirement as marker for
protocol implementation method/prop is the best solution. See, in case
`override` will be required, the initial source file will be like this:

protocol A { func foo() }

class B : A {
override func foo() {...} // implementation
}

and it will compile ok : if A has default implementation and if A has
no default implementation.

So, after you added default implementation in your project - no changes
should be made to that 3rd party source file.

If you are overriding a default implementation of a protocol "conform" /
"implement" is also required.

// Retroactive conformance (old behavior) but only in extensions
extension Foo: @retroactive Baz {
  // only some members of Baz are implemented here (they need the
keywords)
  // the other members outside the extension don't need any additional
keywords
  // note: you can use "@retroactive" and "conform" in conjunction
}

*Future directions:*
"conform(ProtocolName)" / "override(ProtocolName)" can be used to
disambiguate.

// reducing boilerplate
extension Foo: conform Bar {
  // These declarations can only implement Bar and don't need the
"conform" keyword
}

*Final question:*
Should we also require a marker for implemented protocol members in the
interface?:

protocol Foo {
  defaulted func foo()
}
extension Foo {
  implement func foo()
}

Best regards
Maximilian

Am 22.09.2016 um 16:44 schrieb Vladimir.S via swift-evolution
<swift-evolution@swift.org <mailto:swift-evolution@swift.org>
<mailto:swift-evolution@swift.org>>:

On 22.09.2016 11:10, Jean-Denis Muys via swift-evolution wrote:

I watched this thread with a lot of attention, starting neutral. You
must say that Karl won me over. His proposal would make Swift more
expressive, and less error prone in cases of protocol conformance with
name collisions. I am at this point +1

Actually I also support Karl's suggestion in general. It is trying to
solve IMO important problems and make Swift's protocol programming safer
and less fragile. Also it adds new interested features for working with
protocols.

But in reality, I don't feel like his suggestion could be accepted by
core team and community and even if it could be supported, it seems for
me that *implementation* of his proposal requires a huge amount of time
and big changes in how Swift is working currently. (Probably some one who
knows Swift internals could comment regarding this)
So, theoretically we'd have these improvements not in near future and I
think the problem discussed is very important to be addressed in Swift as
soon as possible.
I base my opinion also on previous discussions regarding similar
subjects.

My suggestion regarding a marker for protocol implementation method/prop
in type - solves most of the addressed problems with protocol conformance
and with fragile of such conformance, and adds one new keyword (or even
zero - right now I think the `override` is better choice for such
"marker"). I believe this proposal could be implemented with much less
amount of work and with less changes to current internals of Swift and to
current code base, and so we can have such a big improvement in Swift
soon. So my intention was to suggest solution that can dramatically
improve Swift's protocol programming with "small" amount of changes for
compiler(internals) and for existed sources.

But it seems like the direction chosen by the core team and supported by
many in community - is just a warning if extension conforming type to
protocol contains unrelated to that protocol methods/props. I see that
this solution can improve protocol programming in some areas, but does
not address some IMO important issues we discussed in the thread :

* Currently extension can not have stored properties. So, if we want to
implement protocol's props as stored properties - we can't move them to
extension. So to implement this soulution - we need stored properties in
extensions. It is not clear if and when they are expected.

* This solution will not require the safety(regarding protocol
conformance) from a developer, it will only inform and only if protocol
conformance defined in extension. So, when you use 3rd party source code
- your project will not be protected for the discussed problems.

* To write safe code I can't group methods/props as I want, I have to
declare a number of extensions per-protocol (in case my type conforms to
a number of protocols)

* This solution does not solve problem of near-miss signature of method
definition in protocol extension like here:
protocol A { func foo() }
protocol B : A {}
extension A { func foo() }
extension B { func voo() } // typo. how to "mark" this should be impl?
"my" suggestion:
extension A { override func foo() }
extension B { override func foo() }

* Not clear how to write safe code with that approach if we implement
protocol requirement in derived class, but conformance was declared in
base (but not implemented) :
protocol P { func foo() }
extension P { func foo() }
class A : P {}
class B { func foo() } // we can't move this to extension, B already
conforms to P
, and in opposite to "my" `override` requirement for implementation, if
`A` will add its own foo() implementation - we'll have to change B's
definition(need to add `override` for B.foo )
"my" suggestion:
class B { override func foo() }

Jean-Denis

Sent from my iPhone

On 22 Sep 2016, at 07:15, Karl via swift-evolution >>>>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org> >>>>>>>> <mailto:swift-evolution@swift.org>> wrote:

I would like to make it a requirement if not inside a protocol
extension which declares a conformance, and actually build the
protocol name in to the member in an ABI-breaking way. We could make
it additive by generating forwarding thunks from the old symbols to
the new ones, but it would be better if we could just solve the
overlapping-members problem before then.

That would mean you never get collisions between protocol members.
There’s loads of amazing stuff we can do with that ability, and ways
we can extend it to reduce a lot of boilerplate that occurs when you
want to have multiple representations of the same data (String is just
an example).

I don’t really care about the syntax we need to make it liveable. We
could automatically insert the protocol names for unambiguous members
at call-site, or something else.

This thread was originally about making the *syntax* a requirement; I
agree with that, and I would actually take it one (or several) steps
further, solving other problems along the way.

On 22 Sep 2016, at 06:46, Russ Bishop <xenadu@gmail.com >>>>>>>>> <mailto:xenadu@gmail.com> >>>>>>>>> <mailto:xenadu@gmail.com>> wrote:

On Sep 20, 2016, at 4:34 PM, Dave Abrahams via swift-evolution >>>>>>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org> >>>>>>>>>> <mailto:swift-evolution@swift.org>> wrote:

on Tue Sep 20 2016, Karl <razielim-AT-gmail.com >>>>>>>>>>> <http://razielim-at-gmail.com> >>>>>>>>>>> <http://razielim-at-gmail.com>> >>>>>>>>>>> wrote:

I think the best way is to prefix the member name with the
protocol, e.g:

protocol MyProto { var aVariable : Int func aFunction() } class
MyClass : MyProto { var MyProto.aVariable : Int func
MyProto.aFunction() { … } }

...

CC-ing Dave A, to understand better if this fits with the vision
of protocols

I generally agree with Doug. The canonical way to indicate “this
method/property/type implements a requirement of protocol P”
should be to define the entity in an extension that also adds
conformance to P. If that's inadequate indication in some way we
should find a way to enhance it. I wouldn't mind the notation
above, but only as a fallback, not a reuquirement.

-- -Dave _______________________________________________

Indeed this is exactly how C# handles Interfaces (protocols). The
default is the exact same way Swift works - by matching names. If
there is a collision you specify Protocol.memberName. Its simple and
in the years I was writing C# code it was flexible enough to cover
most reasonable scenarios, without adding a bunch of boilerplate.

Russ

_______________________________________________ swift-evolution
mailing list swift-evolution@swift.org
<mailto:swift-evolution@swift.org> <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________ swift-evolution mailing
list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
<mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
<mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

Hello Vladimir,

Going back to the original suggestion:

/4.1 Different implementation for different protocols/
/class Foo : ProtocolA, ProtocolB {/
/ implement(ProtocolA) func foo() {...}/
/ implement(ProtocolB) func foo() {...}/
/}/
/class Foo : ProtocolA, ProtocolB {/
/ implement ProtocolA {/
/ func foo() {...}/
/ }/
/ implement ProtocolB {/
/ func foo() {...}/
/ }/
/}/

I would rather solve this by implementing the conformance of Foo to either
protocol in its own extension:

Yes, this solution also was discussed in one of last emails. More specifically, the solution where only warning will be raised and only if you conform to protocol in extension(if you conform "in-place" - no any additional feature to express your intention) was discussed.

Will repeat myself:

* Currently extension can not have stored properties. So, if we want to implement protocol's props as stored properties - we can't move them to extension. So to implement this soulution - we need stored properties in extensions. It is not clear if and when they are expected.

Personally, this tastes too much like “multiple base classes”. While I sometimes wish for this myself, I have to come down on the side of “don’t do this”.

* This solution will not require the safety(regarding protocol conformance) from a developer, it will only inform and only if protocol conformance defined in extension. So, when you use 3rd party source code - your project will not be protected for the discussed problems.

True, but it’s better still to avoid introducing keywords that are too specific and address situations that could be solved by “better” (cough), I mean.. different design. ;-)

* To write safe code I can't group methods/props as I want, I have to declare a number of extensions per-protocol (in case my type conforms to a number of protocols)

Introducing new keywords for this purpose does not appeal to me.

* This solution does not solve problem of near-miss signature of method definition in protocol extension like here:
protocol A { func foo() }
protocol B : A {}
extension A { func foo() }
extension B { func voo() } // typo. how to "mark" this should be impl?

It is IMO not the task of the compiler to catch this type of programming errors.
To me this is a classic case that makes the point for unit tests.

* Not clear how to write safe code with that approach if we implement protocol requirement in derived class, but conformance was declared in base (but not implemented) :
protocol P { func foo() }
extension P { func foo() }
class A : P {}
class B { func foo() } // we can't move this to extension, B already conforms to P
, and in opposite to "my" `override` requirement for implementation, if `A` will add its own foo() implementation - we'll have to change B's definition(need to add `override` for B.foo )

While this can happen in “mid-design” I do not think that there should be API’s that require this.
Seems to me that this could be used to implement some kind of abstract classes, but IMO that is a mis-use of protocols. Better to provide useful default implementations or raise the fatal error.

If these questions could be addressed by the "conformance in extension" solution - then I also most likely will think it is the best solution. But right now I see that this solution will not help in many places where we need help from compiler to prevent hard-to-find bugs.

I realize that my objections fall mostly in the category of “IMO”.
But I also think that changes to a language should aim at making the language easier and more consistent to use, not more complex. All too often I have to catch myself at wishing for some feature or other, only to realise that it would complicate matters in general, even if in isolation the wished-for feature would make life easier.

Have a nice WE.
Best,
Rien.

···

On 23 Sep 2016, at 18:25, Vladimir.S <svabox@gmail.com> wrote:
On 23.09.2016 17:41, Rien wrote:

class Foo {}

extension Foo: ProtocolA {
func foo()
}

extension Foo: ProtocolB {
func foo()
}

This way the extra keyword is not necessary.
However it does make it necessary to be able to select the exact foo() an
API user would want.
The API user has that knowledge and can select if via: (Foo as!
ProtocolA).foo()

Or via a convenience dot-contruction: Foo.ProtocolA.foo()

I think that my suggestion may be more work, but it feels to me as if it is
more in line with the general swift-phylosophy.

Regards,
Rien.

On 23 Sep 2016, at 15:08, Vladimir.S <svabox@gmail.com >>> <mailto:svabox@gmail.com>> wrote:

On 23.09.2016 15:10, Rien wrote:

Note: Second attempt, first mail was rejected ?

That is correct Vladimir, at the point of writing an API you never know
who will end up using it in which way.
Hence the decision which flavour (of a function) to call should not be
made by the coder writing the API but by the coder using the API.
And that coder cannot claim not to know which flavour he wants.
Hence including the ‘override’ keyword is unnecessary. However having
the ability to specifying which flavour must be called is necessary. And
this ability is easy to accommodate within the current language rules.
(casting or possibly having a dot-notation for this purpose)

Sorry, I'm not sure I fully understand.. I replied to Maximilian's
suggestion to use `conform` keyword if there is no default implementation
for implemented protocol requirement and use `override` if there is such
default implementation for the requirement. So, I show that we can't
accept such solution as it leads to such kind of dependency when some
other's code depends on your local code. I.e. if you add default
implementations for protocol defined in 3rd party code - you can break
compilation of that code and this should not happen(see my example in
previous message).

As for requirement for any keyword to mark protocol implementation
method/prop in type - there were a lot of description in the thread why
we need this and what kind of problem this could solve and prevent
hard-to-find bugs. Also please look into initial problem of this thread.

Regards,
Rien.

On 23 Sep 2016, at 12:47, Vladimir.S via swift-evolution >>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:

On 23.09.2016 11:05, Maximilian Hünenberger wrote:

I'd also say that one or two keywords are superior than the protocol
naming
approach in terms of implementation simplicity (for the core team).

My suggestions:

Either "conform" or "implement" should be a required keyword for all
properties/functions which implement a protocol (also in protocol
extensions)

"override" should be used if a default implementation or a member of a
superclass is overridden.

Maximilian, again, you *do not know* if the conformed protocol, that
has no default implementations *at the moment of your code writing*
will or will not have default implementations at the *moment of
compilation*.
Consider this scenario:

Step 1. You got 3rd party source file for your project, and you don't
want/have no rights to change it, probably it is shared source used
also in other projects, that code contains:

protocol A { func foo() }

class B : A {
conform func foo() {...}
}

all is OK with this code, no default implementation, B.foo marked with
`conform`.

Step 2. In your project in some of your files you decided to add
default implementation of protocol A:

extension A {
implement func foo() {...}
}

Now, your project will not compile - B.foo() must me marked with
'override' as protocol `A` has default implementation of foo().
If you change `conform` to `override` in 3rd party source file, it will
not compile in some other project where no default implementation
defined for `A` protocol.

That is *why* I believe the `override` as requirement as marker for
protocol implementation method/prop is the best solution. See, in case
`override` will be required, the initial source file will be like this:

protocol A { func foo() }

class B : A {
override func foo() {...} // implementation
}

and it will compile ok : if A has default implementation and if A has
no default implementation.

So, after you added default implementation in your project - no changes
should be made to that 3rd party source file.

If you are overriding a default implementation of a protocol "conform" /
"implement" is also required.

// Retroactive conformance (old behavior) but only in extensions
extension Foo: @retroactive Baz {
// only some members of Baz are implemented here (they need the
keywords)
// the other members outside the extension don't need any additional
keywords
// note: you can use "@retroactive" and "conform" in conjunction
}

*Future directions:*
"conform(ProtocolName)" / "override(ProtocolName)" can be used to
disambiguate.

// reducing boilerplate
extension Foo: conform Bar {
// These declarations can only implement Bar and don't need the
"conform" keyword
}

*Final question:*
Should we also require a marker for implemented protocol members in the
interface?:

protocol Foo {
defaulted func foo()
}
extension Foo {
implement func foo()
}

Best regards
Maximilian

Am 22.09.2016 um 16:44 schrieb Vladimir.S via swift-evolution
<swift-evolution@swift.org <mailto:swift-evolution@swift.org>
<mailto:swift-evolution@swift.org>>:

On 22.09.2016 11:10, Jean-Denis Muys via swift-evolution wrote:

I watched this thread with a lot of attention, starting neutral. You
must say that Karl won me over. His proposal would make Swift more
expressive, and less error prone in cases of protocol conformance with
name collisions. I am at this point +1

Actually I also support Karl's suggestion in general. It is trying to
solve IMO important problems and make Swift's protocol programming safer
and less fragile. Also it adds new interested features for working with
protocols.

But in reality, I don't feel like his suggestion could be accepted by
core team and community and even if it could be supported, it seems for
me that *implementation* of his proposal requires a huge amount of time
and big changes in how Swift is working currently. (Probably some one who
knows Swift internals could comment regarding this)
So, theoretically we'd have these improvements not in near future and I
think the problem discussed is very important to be addressed in Swift as
soon as possible.
I base my opinion also on previous discussions regarding similar
subjects.

My suggestion regarding a marker for protocol implementation method/prop
in type - solves most of the addressed problems with protocol conformance
and with fragile of such conformance, and adds one new keyword (or even
zero - right now I think the `override` is better choice for such
"marker"). I believe this proposal could be implemented with much less
amount of work and with less changes to current internals of Swift and to
current code base, and so we can have such a big improvement in Swift
soon. So my intention was to suggest solution that can dramatically
improve Swift's protocol programming with "small" amount of changes for
compiler(internals) and for existed sources.

But it seems like the direction chosen by the core team and supported by
many in community - is just a warning if extension conforming type to
protocol contains unrelated to that protocol methods/props. I see that
this solution can improve protocol programming in some areas, but does
not address some IMO important issues we discussed in the thread :

* Currently extension can not have stored properties. So, if we want to
implement protocol's props as stored properties - we can't move them to
extension. So to implement this soulution - we need stored properties in
extensions. It is not clear if and when they are expected.

* This solution will not require the safety(regarding protocol
conformance) from a developer, it will only inform and only if protocol
conformance defined in extension. So, when you use 3rd party source code
- your project will not be protected for the discussed problems.

* To write safe code I can't group methods/props as I want, I have to
declare a number of extensions per-protocol (in case my type conforms to
a number of protocols)

* This solution does not solve problem of near-miss signature of method
definition in protocol extension like here:
protocol A { func foo() }
protocol B : A {}
extension A { func foo() }
extension B { func voo() } // typo. how to "mark" this should be impl?
"my" suggestion:
extension A { override func foo() }
extension B { override func foo() }

* Not clear how to write safe code with that approach if we implement
protocol requirement in derived class, but conformance was declared in
base (but not implemented) :
protocol P { func foo() }
extension P { func foo() }
class A : P {}
class B { func foo() } // we can't move this to extension, B already
conforms to P
, and in opposite to "my" `override` requirement for implementation, if
`A` will add its own foo() implementation - we'll have to change B's
definition(need to add `override` for B.foo )
"my" suggestion:
class B { override func foo() }

Jean-Denis

Sent from my iPhone

On 22 Sep 2016, at 07:15, Karl via swift-evolution >>>>>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org> >>>>>>>>> <mailto:swift-evolution@swift.org>> wrote:

I would like to make it a requirement if not inside a protocol
extension which declares a conformance, and actually build the
protocol name in to the member in an ABI-breaking way. We could make
it additive by generating forwarding thunks from the old symbols to
the new ones, but it would be better if we could just solve the
overlapping-members problem before then.

That would mean you never get collisions between protocol members.
There’s loads of amazing stuff we can do with that ability, and ways
we can extend it to reduce a lot of boilerplate that occurs when you
want to have multiple representations of the same data (String is just
an example).

I don’t really care about the syntax we need to make it liveable. We
could automatically insert the protocol names for unambiguous members
at call-site, or something else.

This thread was originally about making the *syntax* a requirement; I
agree with that, and I would actually take it one (or several) steps
further, solving other problems along the way.

On 22 Sep 2016, at 06:46, Russ Bishop <xenadu@gmail.com >>>>>>>>>> <mailto:xenadu@gmail.com> >>>>>>>>>> <mailto:xenadu@gmail.com>> wrote:

On Sep 20, 2016, at 4:34 PM, Dave Abrahams via swift-evolution >>>>>>>>>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org> >>>>>>>>>>> <mailto:swift-evolution@swift.org>> wrote:

on Tue Sep 20 2016, Karl <razielim-AT-gmail.com >>>>>>>>>>>> <http://razielim-at-gmail.com> >>>>>>>>>>>> <http://razielim-at-gmail.com>> >>>>>>>>>>>> wrote:

I think the best way is to prefix the member name with the
protocol, e.g:

protocol MyProto { var aVariable : Int func aFunction() } class
MyClass : MyProto { var MyProto.aVariable : Int func
MyProto.aFunction() { … } }

...

CC-ing Dave A, to understand better if this fits with the vision
of protocols

I generally agree with Doug. The canonical way to indicate “this
method/property/type implements a requirement of protocol P”
should be to define the entity in an extension that also adds
conformance to P. If that's inadequate indication in some way we
should find a way to enhance it. I wouldn't mind the notation
above, but only as a fallback, not a reuquirement.

-- -Dave _______________________________________________

Indeed this is exactly how C# handles Interfaces (protocols). The
default is the exact same way Swift works - by matching names. If
there is a collision you specify Protocol.memberName. Its simple and
in the years I was writing C# code it was flexible enough to cover
most reasonable scenarios, without adding a bunch of boilerplate.

Russ

_______________________________________________ swift-evolution
mailing list swift-evolution@swift.org
<mailto:swift-evolution@swift.org> <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________ swift-evolution mailing
list swift-evolution@swift.org <mailto:swift-evolution@swift.org>
<mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
<mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution