[swift-evolution] [Pitch] Rename protocol<> to Any<>

Austin Zheng austinzheng at gmail.com
Thu May 19 02:33:46 CDT 2016


Sorry, you're right about the timeframe. The timeframe I was looking at was for the DP release, not the final release.

What I was thinking of was Joe Groff's comment in the other thread:

"I think any discussion of extending existentials has to be considered out of scope for Swift 3, though, so the Any rename deserves its own proposal."

This proposal is in light of that comment.

Austin

> On May 19, 2016, at 12:26 AM, Adrian Zubarev via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Is it really in a month? Who said that? Chris told everyone that until August we can still talk about changes for Swift 3. The evolution repository says Swift 3 will drop late this year not mid. But it’s the core team to decide which proposals they would prefer. This one would be way easier to complete until Swift 3, but it also implies that my and your proposal should be accepted/deffered for Swift 3.x. Otherwise this would be strange just to rename protocol<> to Any<> and not to accept the enhancement of it. :D
> 
> -- 
> Adrian Zubarev
> Sent with Airmail
> 
> Am 19. Mai 2016 bei 09:18:43, Austin Zheng (austinzheng at gmail.com <mailto:austinzheng at gmail.com>) schrieb:
> 
>> I've come to the conclusion that the best course of action is to propose this syntax-only change for Swift 3, and then advance the generalized existential proposal after Swift 3 ships. You can ask the reviewers to consider your proposal instead of this one, but given that the Swift 3 release date is in a month I don't think it's likely that anything more substantial than this will be accepted. You are welcome to try, of course.
>> 
>> (response inline, below)
>> 
>>> On May 19, 2016, at 12:11 AM, Adrian Zubarev via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> 
>>> Austin do we really need this 3rd proposal? This makes my original one really a waste of time. I was trying to solve https://openradar.appspot.com/20990743 <https://openradar.appspot.com/20990743> with the original `Any<>` proposal when Swift 3 ships. Your other proposal would enhance it without introducing breaking changes.
>>> 
>>>> To that end, I’d suggest Any<>,Any<Any, XX>, and Any<Any<XX>> all cause warnings.
>>> 
>>> Why would these cause warnings?
>>> 
>>> func foo(any: protocol<>)
>>> 
>>> func foo(any: protocol<Any>)
>>> 
>>> func foo(any: protocol<Any, ProtocolA>)
>>> 
>>> func foo(any: protocol<ProtocolA>)
>>> 
>>> Everything is already fine today.
>>> 
>>> 
>> 
>> I agree, adding new warnings is out of the scope of this proposal.
>> 
>>> -- 
>>> Adrian Zubarev
>>> Sent with Airmail
>>> 
>>> Am 19. Mai 2016 bei 08:55:54, David Waite via swift-evolution (swift-evolution at swift.org <mailto:swift-evolution at swift.org>) schrieb:
>>> 
>>>> My feedback is that we should narrow what is acceptable for Any as much as possible, because relaxing restrictions in the future won’t break existing code.
>>>> 
>>>> To that end, I’d suggest Any<>,Any<Any, XX>, and Any<Any<XX>> all cause warnings.
>>>> 
>>>> -DW
>>>> 
>>>> > On May 19, 2016, at 12:43 AM, Austin Zheng <austinzheng at gmail.com <mailto:austinzheng at gmail.com>> wrote:
>>>> > 
>>>> > Does anyone want to speak up in favor of 'Any<>'? The more I think about it the more I think 'Any' should just be the single, canonical form.
>>>> > 
>>>> > Austin
>>>> > 
>>>> > 
>>>> >> On May 18, 2016, at 11:33 PM, Colin Barrett <colin at springsandstruts.com <mailto:colin at springsandstruts.com>> wrote:
>>>> >> 
>>>> >> There's no need for this, that's what I was trying to get across. It's (likely) a special case in the grammar right now. If we eliminate Any<>, from the point of view of syntax, both Any and Any<Foo, Bar> are just a built in type and normal application of generic arguments (to a built in type).
>>>> >> 
>>>> >> -Colin (via thumbs)
>>>> >> 
>>>> >>> On May 19, 2016, at 1:58 AM, Austin Zheng <austinzheng at gmail.com <mailto:austinzheng at gmail.com>> wrote:
>>>> >>> 
>>>> >>> - 'Any<>' should be allowed. You can currently use 'protocol<>' in your code instead of 'Any'.
>>>> > 
>>>> 
>>>> _______________________________________________
>>>> swift-evolution mailing list
>>>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>>>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160519/27eee7bc/attachment.html>


More information about the swift-evolution mailing list