<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 24, 2016, at 11:14 PM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">[...] what I'm trying to point out here--not mentioned previously--is that one purported major benefit of `where` (putting everything on one line) is inapplicable to the Swift stdlib's own style as well as those of others.</div></div></div></div></div></blockquote><div><br class=""></div><div>That's like saying that you can't use long method names imported from ObjC in Swift. Why can't you use</div><div><br class=""></div><div>for&nbsp;anchor</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>in&nbsp;wall.anchors<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>where boundsRect.contains(anchor.origin)&nbsp;<br class=""><br class=""></div><div>or similar, if you need to fit within the 80 chars - just like you'd do with a compound if statement that exceeds 80 chars.</div><div><br class=""></div><div>The major benefit isn't saving a line (though it's 3 unless you're willing to add { continue } on the same line), but to express your intend to filter the array right within the for-in statement.</div><div><br class=""></div><div>When you look around someone else's code, you immediately see that the person is only going through anchors without bounds without the need to examine the loop's body, which may be collapsed (hidden) by the editor.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class=""></div><div class="">I think you made your point clearly in the discussions and proposal. Please allow other people to have their own opinions in this review :), otherwise it is not a review imo.&nbsp;</div></div></blockquote><div class=""><br class=""></div><div class="">You may note that I've confined my comments to particulars raised by others' comments. And, FWIW, I haven't actually reviewed the proposal, so I'm not sure how you know how I feel about it.</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><span class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">But 80-character lines is a common style, and I would say that a corollary of "to each their own" is that Swift's grammar should be usable and useful whether or not you adhere to such style choices.</div><div class=""><br class=""></div><div class="">If the chief advantage of `where` is that it (quoting someone above) allows one to "<span style="font-size:13px" class="">understand as much as possible about the control flow of the loop from a single line of code," then we ought perhaps to question its appropriateness when the majority of its benefits [by which I mean, based on your examples and Sean's, more than half of the instances in which it is used] cannot be realized in a very common coding style.</span></div><div class=""><br class=""></div></div></div></div>
</div></blockquote></span><span class=""><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></span></div></blockquote></div><br class=""></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>