<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="">Example:<div class=""><br class=""></div><div class="">for 1...5 {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>guard let data = self.loadSomeData() else {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>/// Will try it several times and then report failure to the user.</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>continue</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>// process data</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>return</div><div class="">}</div><div class=""><br class=""></div><div class="">// Error, failed to load data even after retrying.</div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Jul 5, 2016, at 9:23 AM, Jose Cheyo Jimenez <<a href="mailto:cheyo@masters3d.com" class="">cheyo@masters3d.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""></div><div class="">How would you build a condition to break if you are ignoring each value ? Unless you are hard coding a condition in which case I would still argue that the proposed shorthand for is less clear than `for _ in` or forEach. </div><div class=""><br class="">On Jul 4, 2016, at 9:29 PM, Charlie Monroe <<a href="mailto:charlie@charliemonroe.net" class="">charlie@charliemonroe.net</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div class=""><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 class=""><br class=""></div><div class="">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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></blockquote></div></div></blockquote></div><br class=""></div></div></body></html>