The back tick option is interesting. Back tick means "don't treat this as an expression" which allows us to use keywords in certain areas but have them. Act as something that isn't a keyword.<br><br>let f = `foo()`<br><br>However looking at it like this it almost looks like a string.<br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 23, 2017 at 9:16 AM Ben Rimmington via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On 22 Feb 2017, at 07:05, Jacob Bandes-Storch wrote:</div><br class="m_-7200954238290650877Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><b class="gmail_msg">Compound name syntax</b> —<span class="m_-7200954238290650877Apple-converted-space gmail_msg"> </span><font face="monospace, monospace" class="gmail_msg">foo(_:)</font>,<span class="m_-7200954238290650877Apple-converted-space gmail_msg"> </span><font face="monospace, monospace" class="gmail_msg">foo(bar:)</font>,<span class="m_-7200954238290650877Apple-converted-space gmail_msg"> </span><font face="monospace, monospace" class="gmail_msg">foo(bar:baz:)</font><span class="m_-7200954238290650877Apple-converted-space gmail_msg"> </span>— is used to disambiguate references to functions. (You might've used it inside a #selector expression.) But there's currently no compound name for a function with no arguments.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br class="gmail_msg"></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><div class="gmail_msg"><font face="monospace, monospace" class="gmail_msg"> func foo() {} // no compound syntax for this one :(</font></div><div class="gmail_msg"><font face="monospace, monospace" class="gmail_msg"> func foo(_ bar: Int) {} // foo(_:)</font></div><div class="gmail_msg"><font face="monospace, monospace" class="gmail_msg"> func foo(bar: Int) {} // foo(bar:)</font></div><div class="gmail_msg"><font face="monospace, monospace" class="gmail_msg"> func foo(bar: String, baz: Double) {} // foo(bar:baz:)</font></div></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br class="gmail_msg"></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg">Given these four functions, only the first one has no compound name syntax. And the simple reference "<font face="monospace, monospace" class="gmail_msg">let myfn = foo</font>" is ambiguous because it could refer to any of the four. A workaround is to specify a contextual type, e.g. "<font face="monospace, monospace" class="gmail_msg">let myfn = foo as () -> Void</font>".</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br class="gmail_msg"></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg">I filed <a href="https://bugs.swift.org/browse/SR-3550" class="gmail_msg" target="_blank">SR-3550</a> for this a while ago, and there was some discussion in JIRA about it. I'd like to continue exploring solutions here and then write up a formal proposal.</div></div></blockquote></div><br class="gmail_msg"></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">Would the following be an option?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><font face="Menlo" class="gmail_msg"><span class="m_-7200954238290650877Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span> foo() // Function call expression.</font></div><div class="gmail_msg"><font face="Menlo" class="gmail_msg"><span class="m_-7200954238290650877Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>`foo()` // Function reference (using backticks).</font></div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-- Ben</div></div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>