<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="">On Jun 9, 2016, at 3:18 PM, Rob Norback <<a href="mailto:rnorback@gmail.com" class="">rnorback@gmail.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class="">Def like this change, but Erica I'm wondering what changed your mind about the syntax since the last I read you still were concerned by the ambiguity between filtering and exiting.<br class=""></div></blockquote><div><br class=""></div><div>My concerns remain. However, after going back and forth with Brent, </div><div>wux, and others, I think my concerns could be addressed in style guides </div><div>and linters[1]. This draft introduces a major consistency win, I get to rail </div><div>against actually using the feature when I publicly opine[2], but when </div><div>used it will be <i class="">better. </i>(I'm quite curious to see hear from someone on the </div><div>core team whether this change is practical and whether it improves parsing </div><div>or makes it harder from the compiler's point of view.)</div><div><br class=""></div><div>In any case, I reserve the right to argue from several different points of </div><div>view[1, <i class="">ibid</i>] to see how well each suggestion works (and to hear the feedback </div><div>and opinions of others) before settling on anything. Until it's a pull request, it's </div><div>not fixed. And even then, I still want to listen to arguments.</div><div><br class=""></div><div>-- Erica</div><div><br class=""></div><div>[1] As the Italians say, "<a href="https://en.wikipedia.org/wiki/La_donna_%C3%A8_mobile" class="">La donna è mobile</a>", which translates to "women are furniture." Ask an Italian.</div><div>[2] I find a `where`-less `for-in` loop with `guard` statements to read the most clearly and offer the most maintainable approach. My computation tests show that it is in the top efficiency group.</div><div>[3] Nulla nota 3.</div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Jun 9, 2016 at 1:54 PM Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""></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=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 9, 2016, at 1:57 PM, Haravikk <<a href="mailto:swift-evolution@haravikk.me" target="_blank" class="">swift-evolution@haravikk.me</a>> wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class=""><div class="">I think the idea here is for a change from the first to the second of:</div><div class=""><br class=""></div><div class=""><font face="Monaco" class=""><span style="white-space:pre-wrap" class="">        </span>for eachValue in theValues where eachValue.isOdd { … }</font></div><div class=""><font face="Monaco" class=""><span style="white-space:pre-wrap" class="">        </span>for eachValue where eachValue.isOdd in theValues { … }</font></div><div class=""><br class=""></div><div class="">I’m kind of split on this for a few reasons. The first is that it doesn’t ready quite as well plain like this, however I find it looks a bit better like:</div><div class=""><br class=""></div><div class=""><font face="Monaco" class=""><span style="white-space:pre-wrap" class="">        </span>for (eachValue where eachValue.isOdd) in theValues { … }</font></div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div></div></div><div style="word-wrap:break-word" class=""><div class=""><font face="Menlo" class="">for eachValue where eachValue.isOdd in theValues { ... }</font></div><div class=""><font face="Menlo" class="">for case .Some(let value) where value > 5 in theValues { ... }</font></div><div class=""><br class=""></div><div class="">vs</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">for eachValue in theValues where eachValue.isOdd {...}</font></div><div class=""><div class=""><font face="Menlo" class="">for case .Some(let value) in theValues where value > 5 { ... }</font></div><div class=""><br class=""></div><div class="">It should be parseable without parens.</div><div class=""><br class=""></div></div><div class=""></div></div><div style="word-wrap:break-word" class=""><div class=""><br class=""><blockquote type="cite" class=""><div style="word-wrap:break-word" class=""><div class="">Just to clarify that what we’re looking for in theValues is “eachValue where eachValue.isOdd”, though I could probably learn to read it like this without parenthesis. That said, parenthesis lines up nicely with assignment of tuples like:</div><div class=""><br class=""></div><div class=""><font face="Monaco" class=""><span style="white-space:pre-wrap" class="">        </span>for (eachKey, eachValue where eachValue > 5) in theKeyValuePairs { … }</font></div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class=""><font face="Menlo" class="">for (eachKey, eachValue) where eachValue > 5 in theKeyValuePairs {... }</font></div><br class=""></div><div class="">The where clause is distinct from the pattern</div></div><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""></div><br class=""></div>_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>