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

Jordan Rose jordan_rose at apple.com
Thu Jan 21 18:13:44 CST 2016


> On Jan 20, 2016, at 19:56, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 
>> On Jan 20, 2016, at 7:39 PM, Chris Lattner <clattner at apple.com <mailto:clattner at apple.com>> wrote:
>> 
>> 
>>> On Jan 20, 2016, at 3:48 PM, Douglas Gregor via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> 
>>> 
>>>> On Jan 19, 2016, at 4:52 PM, Douglas Gregor via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>>> 
>>>> 
>>>>> On Jan 19, 2016, at 4:40 PM, Jacob Bandes-Storch <jtbandes at gmail.com <mailto:jtbandes at gmail.com>> wrote:
>>>>> 
>>>>> Is there a well-defined meaning for `#` ? 
>>>> 
>>>> Not yet.
>>>> 
>>>>> What about #selector(x)?
>>>> 
>>>> Objective-C selector formation is a *very* narrow feature to consider stealing one of our few underused sigils.
>>> 
>>> Actually, this isn’t that much different from “#available”, in the sense that it’s a special, compiler-supported expression type for which we don’t want to necessarily steal a keyword. What do others think about “#selector”?
>> 
>> 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".

Jordan

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


More information about the swift-evolution mailing list