There are a couple of ways of solving this issue:<br><br>1 refactor to where loop first, then convert to Swift <br>2 leave a fixit in Xcode that will perform while loop conversion <br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 7, 2015 at 00:04 Sean Heber via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is the exact scenario that lead to my own code base having a few cases of C-style (all of which I&#39;ve now trivially removed). Even so, I do not believe it is worth keeping it around for this reason.<br>
<br>
l8r<br>
Sean<br>
<br>
&gt; On Dec 6, 2015, at 2:37 PM, Michel Fortin via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt; There is actually one good reason I see in favor of keeping the C-style for loop, and only one: ease of porting existing code to Swift.<br>
&gt;<br>
&gt; If you are porting code from another language that uses C-style for loops, currently you can keep the loop as is while you translate all the syntactic differences everywhere. If Swift didn&#39;t had a C-style for loop, then you&#39;d need to rethink the control flow at the same time you are converting everything else, increasing the risk of errors during what is already a delicate operation.<br>
&gt;<br>
&gt; C-style for loops are very common in code you can find everywhere because many languages have it, and therefore there is a lot of algorithms, sometime tricky algorithms you don&#39;t want to mess up, that rely on such loops. Even if you had the desire to convert all of them to for-in loops in your port, rewriting the control flow *at the same time* you are addressing all the other porting issues is much worse than doing it in a separate step *after* the crude port has been tested to work.<br>
&gt;<br>
&gt; In other words: you should avoid refactoring everything in one step. The C-style for loop enables that.<br>
&gt;<br>
&gt; --<br>
&gt; Michel Fortin<br>
&gt; <a href="mailto:michel.fortin@michelf.ca" target="_blank">michel.fortin@michelf.ca</a><br>
&gt; <a href="https://michelf.ca" rel="noreferrer" target="_blank">https://michelf.ca</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>