<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 5, 2016, at 6:59 AM, Douglas Gregor via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><br class="">Sent from my iPhone</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">On Feb 5, 2016, at 12:22 AM, Thomas Krajacic &lt;<a href="mailto:thomas.krajacic@gmail.com" class="">thomas.krajacic@gmail.com</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">I am seeing a problem with the new #selector syntax (latest development snapshot 2016-05-02):</div><div class=""><br class=""></div><div class="">It is not possible to put selectors in an array anymore it seems (example for checking an action against a list of selectors):</div><div class=""><br class=""></div><div class="">[#selector(MainWindowController.save(_:)), #selector(MainWindowController.discardChanges(_:))].contains(anItem.action())</div><div class=""><br class=""></div><div class="">and Xcode reports:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px 0px 0px 12px; text-indent: -12px; font-size: 11px; line-height: normal; font-family: Menlo;">...MainWindowController.swift:132:53: Expected '#]' at end of object literal expression</div><div class="" style="margin: 0px 0px 0px 12px; text-indent: -12px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">...MainWindowController.swift:132:53: Expected 'let' or 'var' in conditional; use '&amp;&amp;' to join boolean conditions</div><div class="" style="margin: 0px 0px 0px 12px; text-indent: -12px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">...MainWindowController.swift:132:133: Braced block of statements is an unused closure</div><div class="" style="margin: 0px 0px 0px 12px; text-indent: -12px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;">...MainWindowController.swift:132:133: Expression resolves to an unused function</div><div class="" style="margin: 0px 0px 0px 12px; text-indent: -12px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br class=""></div></div><div class=""><br class=""></div><div class="">The old syntax works fine:</div><div class=""><br class=""></div><div class="">[Selector("save:"),&nbsp;Selector("discardChanges:")].contains(anItem.action())</div><div class=""><br class=""></div><div class="">Was this change expected?</div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">It's a grammatical ambiguity we had overlooked. Add a space between the [ and # for now, and we'll see what we can do.&nbsp;</div></div></blockquote><div><br class=""></div><div>Fixed in&nbsp;<a href="https://github.com/apple/swift/commit/ab31f088486ff9aa221508c0cad2044904a19fb1" class="">https://github.com/apple/swift/commit/ab31f088486ff9aa221508c0cad2044904a19fb1</a></div><div><br class=""></div><div>Thank you!</div><div><br class=""></div><span class="Apple-tab-span" style="white-space:pre">        </span>- Doug</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">&nbsp; - Doug</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks for looking into it,</div><div class="">Thomas</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 29 Jan 2016, at 01:17, Douglas Gregor via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Jan 28, 2016, at 3:48 PM, Jordan Rose &lt;<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Jan 28, 2016, at 12:12, Douglas Gregor via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi all,<br class=""><br class="">I’ve finished the implementation of SE-0022, the #selector expression. Part of that proposal is the deprecation of the use of string literals to form Selectors, which is something we would like to do in Swift 2.2 (so that we can remove it outright in Swift 3).<br class=""><br class="">However, it’s a non-trivial set of changes, and I’d like review of the corresponding commits before pulling it into the branch. The commits are:<br class=""><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/dccf3155f1fe5400df0c9b51f21a3b8f7fa09b9c" class="">https://github.com/apple/swift/commit/dccf3155f1fe5400df0c9b51f21a3b8f7fa09b9c</a><span class="Apple-converted-space">&nbsp;</span>(Jordan reviewed this)<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/7c0e087cd514c926d9eaa3082679edff626effc8" class="">https://github.com/apple/swift/commit/7c0e087cd514c926d9eaa3082679edff626effc8</a><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/89834f8d5fcce652401ecaeec4addace48cb2fae" class="">https://github.com/apple/swift/commit/89834f8d5fcce652401ecaeec4addace48cb2fae</a><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/f7407f6a4d2c9b20ef1d2aab6dbaff5f9419aa88" class="">https://github.com/apple/swift/commit/f7407f6a4d2c9b20ef1d2aab6dbaff5f9419aa88</a><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/00313a1e7ec4934a1df12541b9a8f2683f28ed67" class="">https://github.com/apple/swift/commit/00313a1e7ec4934a1df12541b9a8f2683f28ed67</a><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/1a830fa541705594bd4b3936de24a20b5b943059" class="">https://github.com/apple/swift/commit/1a830fa541705594bd4b3936de24a20b5b943059</a><span class="Apple-converted-space">&nbsp;</span>&nbsp;(Jordan reviewed this)<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/2a42664129d7e95d182a91858fb268e50373b68b" class="">https://github.com/apple/swift/commit/2a42664129d7e95d182a91858fb268e50373b68b</a><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/37441e1b46cd97d42161455dd712d17ce2ccfe87" class="">https://github.com/apple/swift/commit/37441e1b46cd97d42161455dd712d17ce2ccfe87</a><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/0a359424d7d5bd31c9e7a2f98c15cd9a1fa40328" class="">https://github.com/apple/swift/commit/0a359424d7d5bd31c9e7a2f98c15cd9a1fa40328</a><br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><a href="https://github.com/apple/swift/commit/9a0241bb3bcdde3531d0ba683e8d6668c50c9f58" class="">https://github.com/apple/swift/commit/9a0241bb3bcdde3531d0ba683e8d6668c50c9f58</a><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">I reviewed all of these except</div><div class=""><br class=""></div><div class=""></div><div class=""><a href="https://github.com/apple/swift/commit/89834f8d5fcce652401ecaeec4addace48cb2fae" class="">https://github.com/apple/swift/commit/89834f8d5fcce652401ecaeec4addace48cb2fae</a>&nbsp;(IRGen)</div><div class=""><a href="https://github.com/apple/swift/commit/f7407f6a4d2c9b20ef1d2aab6dbaff5f9419aa88" class="">https://github.com/apple/swift/commit/f7407f6a4d2c9b20ef1d2aab6dbaff5f9419aa88</a>&nbsp;(SILGen)<br class=""></div></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I will say I'm not happy that we don't have any real code completion or IDE support. That seems important for putting it into a release.</div></div></blockquote><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">The code completion we have is just filling in the “selector(@objc method)” after “#” in expression contexts, which is very weak. There are two things we want:</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>* Better code completion in general for compound names, e.g., after “UIView.”, we probably want to see (or have some easy way to get to) the compound name “insertSubview(_:aboveSubview:)”. That’s really SE-0021 not having good code completion.</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>* Within #selector(…), we want to see compound names as the primary completions after a type name, and limit to @objc methods.</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>- Doug</div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">_______________________________________________</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">swift-dev mailing list</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="mailto:swift-dev@swift.org" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">swift-dev@swift.org</a><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://lists.swift.org/mailman/listinfo/swift-dev</a></div></blockquote></div><br class=""></div></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-dev mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-dev@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-dev@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a></div></blockquote></div><br class=""></body></html>