<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>-1 this is why we have collection.forEach{}</div><div><br></div><div>(1...10).forEach {</div><div>// do something. </div><div>}</div><div><br>On Jul 1, 2016, at 12:38 AM, Diego Barros via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><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>
</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>