[swift-evolution] [Review #2] SE-0160: Limiting @objc inference

Douglas Gregor dgregor at apple.com
Mon Apr 3 11:55:04 CDT 2017


> On Apr 1, 2017, at 2:52 AM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
> 
> You're right, I had to re-read the proposal a few times to grasp fully the intention there.
> 
> There was some discussion in the previous thread that this would be needed to infer @objc for implementations of @objc protocol requirements, but I see that this is inferred without any such annotation in this version of the proposal, which IMO is definitely reasonable.

Right. We’ll infer @objc when the declaration implements a requirement of an @objc protocol.

> It seems @objcMembers is really geared towards introspection. That finally clicked just now. Would you consider, for those of us like me who are a little slower on the uptake, making this even more explicit in the spelling? I'm thinking along the lines of `@introspection(objc)`, which nicely leaves open the possibility of future introspection facilities that don't require Objective-C. I get that "members" is meant to decribe what's going on that's different from plain @objc, but for me it took a while to grasp the answer to the question, "Why is this another annotation, or in other words, when would I use this instead?”

Introspection is a legitimate use case, but it’s not the only use case for @objcMembers, and it doesn’t really convey what the attribute does—it makes the members @objc.

	- Doug

> 
> 
> On Fri, Mar 31, 2017 at 13:30 Douglas Gregor <dgregor at apple.com <mailto:dgregor at apple.com>> wrote:
>> On Mar 31, 2017, at 9:35 AM, Xiaodi Wu via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> On Fri, Mar 31, 2017 at 10:29 AM, Chris Lattner via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> Hello Swift community, 
>> 
>> The second review of "SE-0160: Limiting @objc inference" begins now and runs through April 2, 2017. The proposal is available here:
>> 
>> 	https://github.com/apple/swift-evolution/blob/master/proposals/0160-objc-inference.md <https://github.com/apple/swift-evolution/blob/master/proposals/0160-objc-inference.md>
>> 
>> Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at:
>> 
>> 	https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>> 
>> or, if you would like to keep your feedback private, directly to the review manager. 
>> 
>> What goes into a review?
>> 
>> The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
>> 
>> * What is your evaluation of the proposal?
>> 
>> I do think this current iteration is an improvement. I have to say, though, that I prefer Doug Gregor's spelling of `@implicitobjc` over `@objcMembers`. It think the former explains the feature a little better and also happens to be subjectively nicer-looking.
> 
> I think @objcMembers is more precise: it doesn’t imply that the class itself is @objc, just that the members are @objc.
> 
> 	- Doug
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170403/f7d8e02a/attachment.html>


More information about the swift-evolution mailing list