<html><body><div>This is a nice solution that translates nicely without creating too much concern about changing the nature of an algorithm in a complex system. đź‘Ť<br></div><div><br data-mce-bogus="1"></div><div>Should at least get a nice "fix it" in Xcode though. On survey, we do have developers using the C style syntax, but we're early in the process of transitioning.</div><div><br>On Dec 04, 2015, at 02:52 PM, Johan Jensen &lt;jj@johanjensen.dk&gt; wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div dir="ltr"><div><div>With the removal of post/pre-increment/decrement you might as well translate C-style for-loops to something akin to<br><br></div>for var i in 0..&lt;10 {<br>&nbsp;&nbsp;&nbsp; ...<br>}<br><br></div>If more advanced C-style for-loops are needed, I am sure most developers can use a while-loop (as mentioned by Ray Fix) until they get accustomed to Swift’s syntax. <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 11:37 PM, Joe Groff <span dir="ltr">&lt;<a href="mailto:jgroff@apple.com" data-mce-href="mailto:jgroff@apple.com">jgroff@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px #ccc solid; padding-left: 1ex;" data-mce-style="margin: 0 0 0 0.8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><div>You might ease the pain by approximating C-style 'for' by a higher-order function:</div><div><br></div><div>func cStyleFor(@autoclosure init initializer: () -&gt; (), @autoclosure test: () -&gt; Bool, @autoclosure inc: () -&gt; (), body: () throws -&gt; ()) rethrows {</div><div>&nbsp; // left as an exercise</div><div>}</div><div><br></div><div>var i = 0</div><div>cStyleFor(init: i = 0, test: i &lt; 10, inc: ++i) {</div><div>&nbsp; print(i)</div><div>}</div><div><br></div><div>-Joe</div><br><div><blockquote type="cite"><span class=""><div>On Dec 4, 2015, at 2:33 PM, Colin Cornaby &lt;<a href="mailto:colin.cornaby@mac.com" data-mce-href="mailto:colin.cornaby@mac.com">colin.cornaby@mac.com</a>&gt; wrote:</div><br></span><div><div><span class=""><div>I was talking with people in the office about this proposal today, in since there has been such a long discussion already I'll just reply to the top of the tree just to get our take in before the review...</div><div><br></div><div>It's understood that Swift has better, more readable ways to do for loops, but C style for loops reduce friction for getting our C or C++ developers on board with Swift. Unless there is a gain elsewhere to be made in their removal, it would be nice to keep them. As we transition to Swift we can educate developers on better ways to iterate, but it would be nice to have one less thing in the way of getting people writing Swift code.</div><div><br></div><div>We work on a lot of algorithmic code which would be well suited for Swift. And again, I understand that C style for loops are redundant. But it's just one less speed bump in understanding for some of our developers or for porting pure C or C++ code without having to do as much re-validation of algorithms for accidental changes.</div><div><br></div><div>But if it's actively hurting some other part of the language we could probably be talked into it.</div><div><br>On Dec 03, 2015, at 03:32 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" data-mce-href="mailto:erica@ericasadun.com">erica@ericasadun.com</a>&gt; wrote:<br><br></div></span><div><blockquote type="cite"><div style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><span class="">Does Swift still needs C-style for loops with conditions and incrementers?&nbsp;<div><br></div></span><div><span class=""><div><span>&lt;Screen Shot 2015-12-03 at 4.30.15 PM.png&gt;</span></div><div><br></div></span><span class=""><div>More Swift-like construction is already available with <i>for-in</i>-statements and <i>stride</i>.&nbsp;</div><div>This would naturally starve the most common point for -- and ++ operators as well.</div></span></div><div><br></div><div>-- E</div><div><br></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=OFgvmg1J6naJevMotmPmRgzA4p1gcL5s2O89Xj3c0DQwWaI2Zkn0T7Ir0ZhZX5JxhOGd3YPVKqo7V694c-2FCbs4q0bD0JoSqDmVKJlXSPFXuXDd-2BrSCkHJtpH2xW9FNCpsnXhG1CXNS-2BYiwa2avrMmz1klqK9v719yPdWuKsBJaZWK1jLmeFzO0xSa2YmruaZcuht7m9Jfq3dmNJI2I0f-2FXBDGxRbOsbfv3np8d7UbdU-3D" alt="" style="min-height: 1px; width: 1px; border-width: 0; padding: 0; margin: 0;" height="1" border="0" width="1" data-mce-src="https://u2002410.ct.sendgrid.net/wf/open?upn=OFgvmg1J6naJevMotmPmRgzA4p1gcL5s2O89Xj3c0DQwWaI2Zkn0T7Ir0ZhZX5JxhOGd3YPVKqo7V694c-2FCbs4q0bD0JoSqDmVKJlXSPFXuXDd-2BrSCkHJtpH2xW9FNCpsnXhG1CXNS-2BYiwa2avrMmz1klqK9v719yPdWuKsBJaZWK1jLmeFzO0xSa2YmruaZcuht7m9Jfq3dmNJI2I0f-2FXBDGxRbOsbfv3np8d7UbdU-3D" data-mce-style="min-height: 1px; width: 1px; border-width: 0; padding: 0; margin: 0;"></div></blockquote></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=RoDF4MveSEMYBIqIJA6ub1g8cOZ-2BVYvqV-2FqygPhjPn9dSCJq6hHxaKAHz2SgEMUEdmJq-2FsAifCMjI5P2wUJabdikvDGXS5zaIeiAW9VmUaiGFnyIyDQg2eHpiypFZpLqkwlMcSPttbgMOFlDhKsq7OZYMo2NC9kSDKFKCrEgV5UwEzHq3kVy3cvCkNDjAtbKUGaHHbyeqN4xiVXzGIrvZWzJxd5zQxuKao7pxdgeN1w-3D" alt="" style="min-height: 1px; width: 1px; border-width: 0; padding: 0; margin: 0;" height="1" border="0" width="1" data-mce-src="https://u2002410.ct.sendgrid.net/wf/open?upn=RoDF4MveSEMYBIqIJA6ub1g8cOZ-2BVYvqV-2FqygPhjPn9dSCJq6hHxaKAHz2SgEMUEdmJq-2FsAifCMjI5P2wUJabdikvDGXS5zaIeiAW9VmUaiGFnyIyDQg2eHpiypFZpLqkwlMcSPttbgMOFlDhKsq7OZYMo2NC9kSDKFKCrEgV5UwEzHq3kVy3cvCkNDjAtbKUGaHHbyeqN4xiVXzGIrvZWzJxd5zQxuKao7pxdgeN1w-3D" data-mce-style="min-height: 1px; width: 1px; border-width: 0; padding: 0; margin: 0;"></div><span class=""> _______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></blockquote></div><br> <img src="https://u2002410.ct.sendgrid.net/wf/open?upn=KlmFWKNIEcyPEGx2Wqruu-2FaM6I0anrxIOlKS1pgqec64JmPD57SelWBf8STiBYuH5i3ko-2FtD2CU6chZgK79T9K3b3jBmmA5gMpTX5FF5mQnohQWqc0wkDTtpj-2FuZjbkeuGjx9YAUCDfU8j39LzH9ARiDcAzF3Bn8yEUzw1iLutsMLA-2FFkrnHXyH-2FxtuuASWC4iWLDeixQLwaQDsRNIRipB5PAbcL-2ByGZDjYiIwDQNRc-3D" alt="" style="min-height: 1px; width: 1px; border-width: 0; padding: 0; margin: 0;" height="1" border="0" width="1" data-mce-src="https://u2002410.ct.sendgrid.net/wf/open?upn=KlmFWKNIEcyPEGx2Wqruu-2FaM6I0anrxIOlKS1pgqec64JmPD57SelWBf8STiBYuH5i3ko-2FtD2CU6chZgK79T9K3b3jBmmA5gMpTX5FF5mQnohQWqc0wkDTtpj-2FuZjbkeuGjx9YAUCDfU8j39LzH9ARiDcAzF3Bn8yEUzw1iLutsMLA-2FFkrnHXyH-2FxtuuASWC4iWLDeixQLwaQDsRNIRipB5PAbcL-2ByGZDjYiIwDQNRc-3D" data-mce-style="min-height: 1px; width: 1px; border-width: 0; padding: 0; margin: 0;"></div><br>_______________________________________________<br> swift-evolution mailing list<br> <a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br> <br></blockquote></div><br></div></div></blockquote></div></body></html>