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
···
On Jan 20, 2016, at 9:39 PM, Chris Lattner via swift-evolution <swift-evolution@swift.org> wrote:
On Jan 20, 2016, at 3:48 PM, Douglas Gregor via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
On Jan 19, 2016, at 4:52 PM, Douglas Gregor via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
On Jan 19, 2016, at 4:40 PM, Jacob Bandes-Storch <jtbandes@gmail.com <mailto:jtbandes@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.