<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 10, 2016 at 1:14 PM, Ryan Lovelett <span dir="ltr">&lt;<a href="mailto:swift-dev@ryan.lovelett.me" target="_blank">swift-dev@ryan.lovelett.me</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>




<div><div>@Xiaodi Wu a couple of times you&#39;ve said things were &quot;explicit&quot; this or that.<br></div><span class="">
<div> <br></div>
<div>&gt; <span style="background-color:rgb(255,255,255)"><span style="color:rgb(31,31,31)"><span style="font-family:&quot;Source Sans Pro&quot;,sans-serif"><span style="font-size:14px">* Swift is explicitly a C-family language. In most or all other C-family languages, for loop statements allow specification of conditions for exiting the loop but not for filtering. Therefore, Swift&#39;s use of `where` is unprecedented and needs to be learned anew by every user of Swift.</span></span></span></span><br></div>
<div> <br></div>
</span><span class=""><div>&gt; That is worrying if true, because it suggests that it&#39;s enabling &#39;dialects&#39; of Swift, an explicit anti-goal of the language<br></div>
<div> <br></div>
</span><div>Though I&#39;ve never read either of these before as being goals (or for that matter anti-goals). Perhaps I&#39;m looking in the wrong places though. Can you please share these with me?<br></div></div></blockquote><div><br></div><div>These have been gleaned from pronouncements from the core team here on this list. Unfortunately, it&#39;s not easy to search the archives. I&#39;ll give one example, but I&#39;ve seen similar ideas repeated a few times. Obviously, they take place in the context of discussions about other features that are not exactly the same as this, so one can wonder how much they apply here. If they were exactly parallel situations, we wouldn&#39;t be having this discussion.</div><div><br></div><div>Chris Lattner&#39;s response to a proposal to adopt some Python-like syntax that you can use if you like, but don&#39;t have to if you don&#39;t (Dec. 6, 2015):</div><div><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span style="color:rgb(0,0,0)"><br></span>
We&#39;re not interested in fragmenting <b style="background-color:rgb(255,255,102)">Swift</b> into related-but-different <b style="background-color:rgb(255,255,102)">dialect</b>s.<br>
-Chris</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div></div>
<div> <br></div>
<div></div></div></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>In trying to track that information down I read over <a href="https://swift.org/about/" target="_blank">https://swift.org/about/</a> trying to find if I could glean any information about some guiding principles. When I stumbled upon this and wondered if anyone else would find it illuminating.<br></div>
<div> <br></div>
<div>From the &quot;Features&quot; section:<br></div>
<div> <br></div>
<div>&gt; Fast and concise iteration over a range or collection<br></div>
<div> <br></div>
<div>Does this proposal enhance that feature? Does this proposal weaken that feature?<br></div>
<div> <br></div>
<div>I&#39;ve thought about that for a little bit and I&#39;m pretty sure that removing `where` from for in certainly does not enhance that feature from my perspective.<br></div></div></blockquote><div><br></div><div>No, but I don&#39;t think it harms fast and concise iteration; hence, I argue that `where` is redundant.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div></div>
<div> </div>
<div>If I understand everything this all started because `if` can no longer have `where`.  Following that and basing it completely on the example in this proposal (<a href="https://gist.github.com/erica/dd5935eca0d5d06b046184f41d56dd04" target="_blank"></a><a href="https://gist.github.com/erica/dd5935eca0d5d06b046184f41d56dd04#confusion-of-use" target="_blank">https://gist.github.com/erica/dd5935eca0d5d06b046184f41d56dd04#confusion-of-use</a>) it seems to me that the behavior of the `where` clause of the `while` was analogous to the now removed `if` behavior.<br></div>
<div> </div>
<div>Therefore, if we are going to remove something lets remove the `where` clause from `while`.</div></div></blockquote><div><br></div><div>My understanding is that removal from `while` is also part of SE-0099 and already approved.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>As is already correctly pointed out in the &quot;confusion of use&quot; section the outlier behavior was `for in`. We deprecated the `if` behavior because of [fill in the blank], forgive me I never read the arguments, if `while` works the same way why does it not logically follow that its `where` clause also be deprecated.<br></div>
<div> </div>
<div>With that as far as I&#39;m concerned this proposal is just requesting the retirement of the `where` clause on the wrong loop structure. Of course more examples could change my mind.</div></div></blockquote><div><br></div><div>I&#39;ll endeavor to change your mind :) FWIW, I&#39;d be satisfied with reforming instead of removing `where` if doing so can clarify its meaning. </div></div><br></div></div>