[swift-evolution] Review for: Remove C-style for-loops with conditions and incrementers

Dmitri Gribenko gribozavr at gmail.com
Mon Dec 7 15:07:08 CST 2015


My biggest concern with the proposal is the lack of data regarding
equivalents for existing C-style for loops.  Note that I'm not talking
about code that uses C-style for loops in cases where a superior
construct exists in Swift, for example, `for i in myArray.indices`.
I'm interested in seeing cases not covered by that.

For example, it would be good if someone took a look at "git grep 'for
var' stdlib/" and submitted a PR that converts all those loops.  If
that results in readability improvements, it would be a great PR
regardless of the decision on this proposal.

Another concern of mine is the equivalent of C-style for loops with
'continue' statements in them.  The only equivalent based on 'while' I
can think of duplicates the increment portion of the loop.


(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/

More information about the swift-evolution mailing list