[swift-evolution] [Review] SE-0022: Referencing the Objective-C selector of a method
Douglas Gregor
dgregor at apple.com
Wed Jan 20 21:56:38 CST 2016
> On Jan 20, 2016, at 7:39 PM, Chris Lattner <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.
- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160120/9145e32d/attachment.html>
More information about the swift-evolution
mailing list