<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">CGRect(origin:.zero, size:..</div><div class=""><br class=""></div><div class="">is pretty nice. Why do you want to get rid of it?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">return values</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>.flatMap {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>//code</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>.filter {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>//code</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>.sorted { /* code */ <span class="Apple-tab-span" style="white-space:pre">        </span> }</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>.first</div><div class=""><br class=""></div><div class="">is also pretty clean, considering.</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 1, 2016, at 11:06 PM, rintaro ishizaki via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi all,</div><div class=""><br class=""></div><div class="">The compiler currently accepts these expressions:<br class=""></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">x = expr . member</font></div><div class=""><font face="monospace, monospace" class="">x = </font><span style="font-family:monospace,monospace" class="">expr</span><font face="monospace, monospace" class=""> </font><span style="font-family:monospace,monospace" class="">.</span></div><div class=""><font face="monospace, monospace" class=""> member</font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">x = expr</font></div><div class=""><font face="monospace, monospace" class=""> .</font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class=""> member</font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><span style="font-family:monospace,monospace" class="">x = .</span><br class=""></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class=""> implicitMember</font></div></blockquote><div class=""><font face="monospace, monospace" class=""><br class=""></font></div>I propose to reject them because this could cause some unnecessary confusion.<div class="">(especially after <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0071-member-keywords.md" class="">SE-0071</a>)<br class=""><div class="">For instance:<div class=""><div class=""><br class=""></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><div class=""><div class=""><font face="monospace, monospace" class="">_ = foo(.</font></div></div></div><div class=""><div class=""><div class=""><font face="monospace, monospace" class="">func bar(x: Int) { ... }</font></div></div></div></blockquote><div class=""><div class=""><div class=""><br class=""></div><div class="">The current compiler parses this as:</div><div class=""><br class=""></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><div class=""><div class=""><font face="monospace, monospace" class=""><font color="#999999" class="">// call foo(_:_:)</font></font></div></div></div><div class=""><div class=""><font face="monospace, monospace" class="">_ = foo(.func <font color="#999999" class="">// </font></font><span style="color:rgb(153,153,153);font-family:monospace,monospace" class="">implicit-member-expression</span></div><div class=""><span style="color:rgb(153,153,153);font-family:monospace,monospace" class=""> // missing ','</span></div></div><div class=""><div class=""><div class=""><font face="monospace, monospace" class=""> <font color="#999999" class="">// call bar(x:_:) with </font></font><span style="color:rgb(153,153,153);font-family:monospace,monospace" class="">argument 'Int' and trailing closure</span></div></div></div><div class=""><div class=""><div class=""><font face="monospace, monospace" class=""> bar(x<font class="">: Int</font>) { ... }</font></div></div></div><div class=""><div class=""><div class=""><font color="#999999" style="font-family:monospace,monospace" class="">// missing closing ')'</font></div></div></div></blockquote><div class=""><div class=""><div class=""><br class=""></div><div class="">Here's the summary of <i class="">current</i> behavior:<br class=""></div></div><div class=""><br class=""></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><div class=""><font face="monospace, monospace" class="">// accept</font></div></div><div class=""><div class=""><span style="font-family:monospace,monospace" class="">expr</span><font face="monospace, monospace" class="">.member</font></div></div><div class=""><div class=""><font face="monospace, monospace" class=""><br class=""></font></div></div><div class=""><div class=""><font face="monospace, monospace" class="">// accept</font></div></div><div class=""><div class=""><span style="font-family:monospace,monospace" class="">expr</span><font face="monospace, monospace" class=""> .member</font></div></div><div class=""><div class=""><font face="monospace, monospace" class=""><br class=""></font></div></div><div class=""><div class=""><font face="monospace, monospace" class="">// accept</font></div></div><div class=""><span style="font-family:monospace,monospace" class="">expr</span><br class=""></div><div class=""><div class=""><font face="monospace, monospace" class=""> .member</font></div></div><div class=""><div class=""><font face="monospace, monospace" class=""><br class=""></font></div></div><div class=""><div class=""><font face="monospace, monospace" class="">// reject with fix-it to remove white spaces</font></div></div><div class=""><div class=""><span style="font-family:monospace,monospace" class="">expr</span><font face="monospace, monospace" class="">. member</font></div></div><div class=""><div class=""><div class=""><font face="monospace, monospace" class=""><br class=""></font></div></div></div><div class=""><div class=""><div class=""><font face="monospace, monospace" class="">// </font><span style="font-family:monospace,monospace" class="">two distinct statements</span></div></div></div><div class=""><div class=""><span style="font-family:monospace,monospace" class="">expr</span><font face="monospace, monospace" class="">. </font><span style="font-family:monospace,monospace" class="">// reject as missing member name</span></div></div><div class=""><div class=""><div class=""><font face="monospace, monospace" class=""> member</font></div></div></div><div class=""><div class=""><font face="monospace, monospace" class=""><br class=""></font></div></div><div class=""><div class=""><font face="monospace, monospace" class="">// accept</font></div></div><div class=""><div class=""><span style="font-family:monospace,monospace" class="">expr</span><font face="monospace, monospace" class=""> . member</font></div></div><div class=""><div class=""><font face="monospace, monospace" class=""><br class=""></font></div></div><div class=""><div class=""><div class=""><font face="monospace, monospace" class="">// accept</font></div></div></div><div class=""><div class=""><span style="font-family:monospace,monospace" class="">expr</span><font face="monospace, monospace" class=""> .</font></div></div><div class=""><div class=""><div class=""><font face="monospace, monospace" class=""> member</font></div></div></div></blockquote><div class=""><div class=""><br class="">I propose to change the last 2 examples:</div><div class=""><span style="font-family:monospace,monospace" class=""><br class=""></span></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><div class=""><span style="font-family:monospace,monospace" class="">// reject with fix-it to remove white spaces</span></div></div><div class=""><div class=""><font face="monospace, monospace" class="">some . member</font></div></div><div class=""><div class=""><font face="monospace, monospace" class=""><br class=""></font></div></div><div class=""><div class=""><span style="font-family:monospace,monospace" class="">// two distinct statements </span></div></div><div class=""><div class=""><font face="monospace, monospace" class="">some . // reject as missing member name</font></div></div><div class=""><div class=""><font face="monospace, monospace" class=""> member</font></div></div></blockquote><div class=""><div class=""><br class=""></div><div class="">I think, this is consistent behavior with '<font face="monospace, monospace" class="">.</font>' at postfix position.</div><div class=""><br class=""></div><div class="">Specifically:</div><div class=""><ul class=""><li class="">If '<font face="monospace, monospace" class="">.</font>' is at <i class="">prefix-operator</i> or <i class="">unspaced-binary-operator</i> position, accept.<br class=""></li><li class="">If the next token after '<font face="monospace, monospace" class="">.</font>' is at the same line, propose to fix-it.<br class=""></li><li class="">Otherwise, reject it as missing member name.</li></ul></div><div class="">This affect following expressions and types in the grammer:</div><div class=""><br class=""></div><div class="">expressions:</div> self-method-expression<br class=""> self-initializer-expression <br class=""> superclass-method-expression<br class=""> superclass-initializer-express<wbr class="">ion<br class=""> implicit-member-expression<br class=""> initializer-expression<br class=""> explicit-member-expression<br class=""> postfix-self-expression<br class=""> explicit-member-expression<br class=""> postfix-self-expression</div><div class="">types:<br class=""><div class=""> type-identifier<br class=""></div></div> metatype-type<div class=""><br class=""></div><div class="">Of course this is a source breaking change, though.</div><div class="">Any thought?</div><div class=""><br class=""></div></div></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>