Sent from my iPhone > On 14 Jun 2017, at 21:41, Xiaodi Wu via swift-evolution > <[email protected]> wrote: > >> On Wed, Jun 14, 2017 at 3:37 PM, Vladimir.S via swift-evolution >> <[email protected]> wrote: >>> On 14.06.2017 21:23, Haravikk via swift-evolution wrote: >>> >>>> On 14 Jun 2017, at 19:08, Xiaodi Wu via swift-evolution >>>> <[email protected] <mailto:[email protected]>> wrote: >>>> >>>> On Wed, Jun 14, 2017 at 1:01 PM, David Hart via swift-evolution >>>> <[email protected] <mailto:[email protected]>> wrote: >>>> >>>> Sorry, initially sent off-list: >>>> >>>> I think this proposal is a great idea. But I would vote for the >>>> alternative of >>>> only having default and implicitly deducing extend when default is not >>>> specified: >>>> >>>> >>>> This wouldn't work with the fundamental design decision that these are >>>> optional keywords, which IMO is absolutely key. >>> >>> Hmm, I'm inclined to agree with David that only the default keyword really >>> seems like it's necessary, and that extend can be implied. >>> >> >> I'm not so sure. If they are optional, then it depends on developer if >> he/she wants to explicitly mark some func to avoid possible errors. Please >> look here : >> >> 1. First we have this >> >> protocol A { >> func foo() {} >> } >> >> and we write extension (possible in another file) >> >> extension A { >> extent func bar() {} // I'm sure currently I want *additional* 'bar' method >> } >> >> 2. Then 'A' protocol has been changed for some reason : >> >> protocol A { >> func foo() {} >> func bar() {} >> } >> >> Now, if we have 'extent' - we(compiler) can detect the problem here('bar' >> was not the default implementation for A's requirement). Without 'extent' - >> 'bar' will be default implementation without our intent for this. >> >> So, in case suggested keywords are both optional - IMO we need both. >> In case 'default' is required - then yes, we need only it. > > Yes, I think we are all in vigorous agreement about this. The question is > whether, at this point in Swift's evolution, a wide-ranging migration due to > a new required keyword will be well tolerated. If not, then the solution is > constrained. >
I personally vote to accept such a migration at this point, but I am not sure how others feel. >> >>> My preference would be to just add the default keyword, and have breaches >>> treated as warnings using the current behaviour, which we can eliminate and >>> elevate to an error in future once people have had a chance to change their >>> code. >>> >>> >>> _______________________________________________ >>> swift-evolution mailing list >>> [email protected] >>> https://lists.swift.org/mailman/listinfo/swift-evolution >>> >> _______________________________________________ >> swift-evolution mailing list >> [email protected] >> https://lists.swift.org/mailman/listinfo/swift-evolution > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
