<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 10, 2016, at 2:13 PM, Harlan Haskins via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">You could always do your control flow with goto’s anyway…</span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> foo() {</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> i = </span><span style="font-variant-ligatures: no-common-ligatures;" class="">0</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> goto(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> label: </span><span style="font-variant-ligatures: no-common-ligatures;" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures;" class="">"entry"</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">switch</span><span style="font-variant-ligatures: no-common-ligatures" class=""> label {</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">case</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">"entry"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">:</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">print</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">"beginning loop…"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">goto</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"cond"</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">case</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">"cond"</span><span style="font-variant-ligatures: no-common-ligatures" class="">:</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">goto</span><span style="font-variant-ligatures: no-common-ligatures" class="">(i < </span><span style="font-variant-ligatures: no-common-ligatures;" class="">10</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ? </span><span style="font-variant-ligatures: no-common-ligatures;" class="">"body"</span><span style="font-variant-ligatures: no-common-ligatures" class=""> : </span><span style="font-variant-ligatures: no-common-ligatures;" class="">"end"</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">case</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">"body"</span><span style="font-variant-ligatures: no-common-ligatures" class="">:</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> i += </span><span style="font-variant-ligatures: no-common-ligatures;" class="">1</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">print</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"</span><span style="font-variant-ligatures: no-common-ligatures" class="">\</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">i</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)"</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">goto</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"cond"</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">case</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">"end"</span><span style="font-variant-ligatures: no-common-ligatures" class="">:</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">break</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">default</span><span style="font-variant-ligatures: no-common-ligatures;" class="">: </span><span style="font-variant-ligatures: no-common-ligatures" class="">break</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Menlo" class=""> }</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Menlo" class=""> }</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">goto</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font face="Menlo" class="">}</font></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class=""><font face="Menlo" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></font></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class="">Apologies,</div><div style="margin: 0px; font-size: 11px; line-height: normal;" class="">Harlan</div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>And isn’t this the point really. Yes there are many different ways of doing something, but there should be one obvious way. IMHO, there is nothing more obvious than just </div><div><br class=""></div><div>repeat {</div><div><br class=""></div><div>}</div><div><br class=""></div><div>It’s very clear. It’s not about adding complex control flow, it’s about simplifying current syntax. I don’t think anyone is arguing that it’s more powerful than what while loops currently offer.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal;" class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On May 10, 2016, at 2:05 PM, Taras Zakharko via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">When I need a loop with complex control flow that does not fit into the classical while {} or repeat {} while structure, I use this:<br class=""><br class="">do_stuff: do {<br class=""> …<br class=""> continue do_stuff<br class="">} <br class=""><br class="">This pattern explicit and allows very complex control flow patterns without the drawbacks of the unrestricted goto construct. <br class=""><br class="">Therefore I don’t see utility with having a repeat {} without while clause. <br class=""><br class="">Best, <br class=""><br class=""> Taras<br class=""><br class=""><br class=""><blockquote type="cite" class="">On 10 May 2016, at 22:39, Dominik Pich via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On May 10, 2016, at 3:30 PM, Tyler Cloutier via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">Secondly it’s a very simple way of introducing new programmers to loops. It’s IMHO more clear to a new programmer that repeat will just repeat indefinitely vs while true.<br class=""></blockquote><br class="">This point seems strange to me - why teach a new programmer about loops by first showing them a looping construct they should probably never use in actual practice until they really know what they’re doing?<br class=""></blockquote>totally agree… it would be a bad first introduction, id say :)<br class=""><br class="">_______________________________________________<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=""></blockquote><br class="">_______________________________________________<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></div></blockquote></div><br class=""></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>