[swift-evolution] [Review] SE-0022: Referencing the Objective-C selector of a method

Chris Lattner clattner at apple.com
Fri Jan 22 15:36:26 CST 2016


> On Jan 22, 2016, at 12:03 PM, James Campbell <james at supmenow.com> wrote:
> 
> What about other compiler hacks that begin with @? Like @objc ?

@ is for attributes.  This is an expression.

-Chris


> 
> Sent from my iPhone
> 
> On 22 Jan 2016, at 05:19, Chris Lattner via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> 
>> 
>>> On Jan 21, 2016, at 9:17 PM, Erica Sadun <erica at ericasadun.com <mailto:erica at ericasadun.com>> wrote:
>>> 
>>> +1 to setting __LINE__ (and friends) free of their unsightly upper snake case. They look like boa constrictors trying to digest a fully-swallowed keyword.
>> 
>> Yeah, I totally agree.  Actually, the proper spelling would simply be #line - after all, there’d be no need to shout any more…
>> 
>> -Chris
>> 
>> 
>>> 
>>> -- E
>>> 
>>>> On Jan 21, 2016, at 10:04 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>>> 
>>>> 
>>>>> On Jan 21, 2016, at 4:13 PM, Jordan Rose via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>>>> 
>>>>>>> 
>>>>>>> I think that #selector is workable and fits into the model - it would be simple to implement and not cause unnecessary complexity in the implementation.
>>>>>>> 
>>>>>>> That said, I’m in favor of x.selector, or #selector(x).  The former seems more syntactically elegant if it is practical.
>>>>>> 
>>>>>> The latter gives us easy extensions like
>>>>>> 
>>>>>> 	#selector(getter: MyType.property)
>>>>>> 	#selector(setter: MyType.property)
>>>>>> 
>>>>>> #selector is sorta growing on me.
>>>>> 
>>>>> +1 from me. At this point in Swift's evolution, the # feels like "invoke compiler substitution logic here”.
>>>> 
>>>> I agree.  Along those lines, we could consider renaming __LINE__ and friends to #LINE
>>>> 
>>>> -Chris
>>>> _______________________________________________
>>>> 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/20160122/068086de/attachment.html>


More information about the swift-evolution mailing list