<html><body><div id="edo-message"><div>-1. I like the underscore. If it turns out you do need the loop variable later, it's easy to see where to add it.<br><br><div style="font-family: 'Helvetica Neue','Helvetica',Helvetica,Arial,sans-serif;font:'-apple-system-body';">Karl</div></div></div><div id="edo-original"><div><br><br><blockquote type="cite" style="margin:1ex 0 0 0;border-left:1px #ccc solid;padding-left:0.5ex;"><div>On Jul 1, 2016 at 9:38 AM, <<a href="mailto:swift-evolution@swift.org">Diego Barros via swift-evolution</a>> wrote:<br><br></div><div><div dir="ltr"><div class="gmail_default"><font face="monospace, monospace">When you want a simple `for` loop, for example:</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default">
<p class=""><font face="monospace, monospace"><span class="">for</span><span class=""> </span><span class="">_</span><span class=""> </span><span class="">in</span><span class=""> </span><span class="">1</span><span class="">...</span><span class="">10</span><span class=""> {</span></font></p>
</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default"><p class=""><font face="monospace, monospace">// do something 10 times</font></p></div></blockquote><div class="gmail_default"><p class=""><font face="monospace, monospace">}</font></p><p class=""><font face="monospace, monospace"><br></font></p><p class=""><font face="monospace, monospace">Clean-up and simplify the syntax by removing the superfluous underscore and `in`:</font></p><p class=""><font face="monospace, monospace"><br></font></p><p class=""><font face="monospace, monospace"><span class="">for</span><span class=""> </span><span class="">1</span><span class="">...</span><span class="">10</span><span class=""> {</span></font></p></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default"><p class=""><font face="monospace, monospace">// do something 10 times</font></p></div></blockquote><div class="gmail_default"><p class="">
</p><p class=""><span class=""><font face="monospace, monospace">}</font></span></p></div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font face="monospace, monospace"><br></font><div><font face="monospace, monospace">-- diego</font></div></div></div></div></div></div>
</div>
_______________________________________________
swift-evolution mailing list
<a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="1">swift-evolution@swift.org</a>
<a dir="ltr" href="https://lists.swift.org/mailman/listinfo/swift-evolution" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="2">https://lists.swift.org/mailman/listinfo/swift-evolution</a>
</div></blockquote></div></div></body></html>