<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div><br>On Jun 10, 2016, at 1:08 AM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">On Thu, Jun 9, 2016 at 9:45 PM, Dany St-Amant <span dir="ltr">&lt;<a href="mailto:dsa.mls@icloud.com" target="_blank">dsa.mls@icloud.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><span class=""><div><br></div><div>Le 9 juin 2016 à 14:55, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; a écrit&nbsp;:<br><br></div><blockquote type="cite"><div>There have been, in previous threads, several examples given where users of Swift have found the behavior of `where` to be misleading and confusing.<br></div></blockquote><div><br></div></span><div><span style="background-color:rgba(255,255,255,0)">Sorry Xiaodi, but beside you (on multiple instances), and recently Erica, I have do not recall hearing that many voices saying that 'where' is confusing.</span></div></div></blockquote><div><br></div><div>Shawn Erickson wrote this to the list just yesterday:</div><div><br></div><div><span style="font-size:13px;white-space:pre-wrap">"I support your position on the use of where and while/when being confusing in the loop statement. I (and I know others) have for example used where in a loop statement mistakenly thinking it would terminate the loop early but of course learned that it basically filters what causes the loop body to be executed. After the fact that made sense to me but it didn't click at first."</span><br></div></div></div></div></div></blockquote><div><br></div><div>Couldn't we find examples of anyone being confused at any syntax? Especially with an unfamiliar construct in a new language.&nbsp;</div><div><br></div><div>If people find the new proposed syntax confusing, do we pull that too? At what point do we stop?</div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div><span style="background-color:rgba(255,255,255,0)"> Yes, there's was maybe even less voices stating that it is not confusing, but which group is more vocal?</span></div><div><span style="background-color:rgba(255,255,255,0)"><br></span></div><div><span style="background-color:rgba(255,255,255,0)">Maybe I have been recently corrupt by Solid SQL queries:</span></div><div><span style="background-color:rgba(255,255,255,0)">select * from PEOPLE_TABLE where AGE_FIELD = 100</span></div><div><span style="background-color:rgba(255,255,255,0)"><br></span></div><div><span style="background-color:rgba(255,255,255,0)">Or by my (likely) broken English:</span></div><div><span style="background-color:rgba(255,255,255,0)">The places where I had the most fun</span></div><div><span style="background-color:rgba(255,255,255,0)"><br></span></div><div><span style="background-color:rgba(255,255,255,0)">But, to me, where can only suggest some filtering (thus tag to a for .. &nbsp;in .., continue if not matching).&nbsp;</span></div></div></blockquote><div><br></div><div>I'm glad that you find it very clear. I do as well. That does not mean it is clear to everyone.</div></div></div></div></blockquote><div><br></div><div>I still have yet to see widespread confusion of this. A few people learning swift here or there, but once they learn the syntax...do they still find it confusing?</div><div><br></div><div>I expect some concrete data on stuff like this...especially with proposed syntax changes.&nbsp;</div><div><br></div><div>Without concrete examples, what would stop one from coming in here and waving their hands around to push *what they like* through?</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div><span style="background-color:rgba(255,255,255,0)">I know there's a linguist on the list, maybe he could comment on whether or not using 'where' as a filter is proper or an abomination.</span></div><div><br></div><div>I do not think that because something is confusing to some, or at first, that it warrant removal from the language.</div></div></blockquote><div><br></div><div>It is a very bad sign if something is confusing at first, especially to a significant proportion of users. It's true by definition that once you have mastered something you are no longer confused by it.</div></div></div></div></div></blockquote><div><br></div><div>Again, where is this significant proportion of users? I don't mean to hound you on this, but I am genuinely curious where this is all coming from.&nbsp;</div><div><br></div><div>The burden of evidence is on the proposers of these ideas.&nbsp;</div><div><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>As has been stated on this list, education is a valid and important consideration for Swift. If something is confusing rather than difficult (and the *concept* of filtering a list is not at all a difficult concept), and if the same underlying concept can already be invoked in alternative and equivalent ways that are not confusing, then it's a no-brainer that the confusing thing is harmful to the language and should be removed on that basis alone.</div></div></div></div></div></div></blockquote><div><br></div><div>What is clear to one person may be confusing to another. There is no perfect syntax that will not make it confusing for some users.&nbsp;</div><div><br></div><div>----</div><div><br></div><div>I really think it is important to come armed with more information with these proposals. It's easy to say a significant proportion of people are confused but it would make me much more comfortable to see this data to back it up.&nbsp;</div><div><br></div><div>What if we are spinning our wheels for no reason on a feature that *most* don't find confusing? What if we make a bigger proportion of those who did understand it more confused now?</div><div><br></div><div>Brandon&nbsp;</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>By analogy, Chinese and Japanese share difficult writing systems. Yet many people use those languages daily without difficulty. Does that mean there's not a problem? Far from it: in fact, you'll find that many intelligent people have devoted their life's work to mitigating the issue. Both Chinese and Japanese underwent a round of simplification in the 20th century. Think about it: real languages used for daily life by a significant fraction of the world's population were revamped for the purpose of increasing accessibility to new learners.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div>The by-value/by-reference is well define, but can be confusing at first. Same goes for eager/lazy processing, or escaping vs non-escaping closure, or even the difference between closure and function. But no one suggest to remove them.</div></div></blockquote><div><br></div><div>Value types vs. reference types is a concept (and a moderately advanced one), eager vs. lazy processing is a concept (and a moderately advanced one), and closures are a concept (and definitely an advanced one).</div><div><br></div><div>Filtering a collection is a concept as well, and no one is suggesting its removal. We are proposing to simplify and rationalize the syntax by which filtering is invoked. If there were a way to dramatically simplify the syntax surrounding value types and reference types so as to diminish confusion, you can absolutely guarantee that there would be proposals to change the syntax. If I could think of one tomorrow, you'd see a thread tomorrow about it. I don't think I'm that smart though.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><span class=""><font color="#888888"><div><br></div><div>Dany</div></font></span><span class=""><div><br></div><blockquote type="cite"><div>In fact, the first of these proposals began with a question: how does one write arbitrary Boolean assertions after a let binding? The answer (use `where`) was found to be misleading and confusing.<br><br>I think you're being unfair to say that these proposals have no purpose other than an academic consistency.<br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 9, 2016 at 13:29 Jon Shier via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">&nbsp; &nbsp; &nbsp; &nbsp; As time goes on, I’m feeling more and more that these consistency proposals are sorely misguided. Frankly, unless the syntax is confusing or misleading, even once the developer has learned the guiding principles of Swift, consistency is not a good argument for change. This proposal is the perfect example of this. No one will find the use of “where” in loops confusing, aside from those who will wonder why it was removed from if statements. There is no misleading behavior or confusing syntax here. This is just consistency for consistency’s sake. Once this proposal is done, then another will be made to remove “where” from another place in the language. Then another and another until it’s gone completely and a very useful part of the language is removed in the name of consistency. Which really just comes down to “where” isn’t used here, so it can’t be used there anymore. It’s death by a thousand cuts.<br>
<br>
<br>
<br>
Jon Shier<br>
<br>
<br>
&gt; On Jun 9, 2016, at 1:16 PM, Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; On Jun 9, 2016, at 11:11 AM, Charlie Monroe &lt;<a href="mailto:charlie@charliemonroe.net" target="_blank">charlie@charliemonroe.net</a>&gt; wrote:<br>
&gt;&gt; See my latest post - included results with -Ofast. But still, using filter and lazy.filter is 10+% slower, which were the suggested alternatives to `where`.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; I need to correct this misapprehension.<br>
&gt; My suggested alternative to where was and remains `guard`.<br>
&gt;<br>
&gt; -- E<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></span></div></blockquote></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>