<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class="">-1 this is why we have collection.forEach{}<br class=""><div class=""><div dir="auto" class=""><div class=""><br class=""></div><div class="">(1...10).forEach {</div><div class="">// do something. </div><div class="">}</div></div></div></blockquote><div><br class=""></div><div>This is not equivalent since it doesn't allow you to break from the for loop.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><br class="">On Jul 1, 2016, at 12:38 AM, Diego Barros via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_default"><font face="monospace, monospace" class="">When you want a simple `for` loop, for example:</font></div><div class="gmail_default"><font face="monospace, monospace" class=""><br class=""></font></div><div class="gmail_default"><p class=""><font face="monospace, monospace" class=""><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" class=""><div class="gmail_default"><p class=""><font face="monospace, monospace" class="">// do something 10 times</font></p></div></blockquote><div class="gmail_default"><p class=""><font face="monospace, monospace" class="">}</font></p><p class=""><font face="monospace, monospace" class=""><br class=""></font></p><p class=""><font face="monospace, monospace" class="">Clean-up and simplify the syntax by removing the superfluous underscore and `in`:</font></p><p class=""><font face="monospace, monospace" class=""><br class=""></font></p><p class=""><font face="monospace, monospace" class=""><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" class=""><div class="gmail_default"><p class=""><font face="monospace, monospace" class="">// do something 10 times</font></p></div></blockquote><div class="gmail_default"><div class="">
<br class="webkit-block-placeholder"></div><p class=""><span class=""><font face="monospace, monospace" class="">}</font></span></p></div><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><font face="monospace, monospace" class=""><br class=""></font><div class=""><font face="monospace, monospace" class="">-- diego</font></div></div></div></div></div></div>
</div>
</div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>