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

Charles Srstka cocoadev at charlessoft.com
Wed Jan 20 22:19:16 CST 2016


> On Jan 20, 2016, at 9:39 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org> 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.

Why not x.#selector? This would still be more elegant than the second option, but would not cause ambiguity in the case that the type of x happens to have a property named “selector”.

Charles

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


More information about the swift-evolution mailing list