<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="">Hi,<div class=""><br class=""></div><div class="">I am new to Swift mailing list so I don’t know if this topic has already been discussed.<br class=""><div class=""><br class=""></div><div class="">I like Swift's range operators ..< and …</div><div class="">What I am missing though is an easy operator to create a range with a specified step. Currently, if you would want to iterate over some odd numbers, you had to write:</div><div class=""><i class="">for i in 1.stride(through: 7, by: 2) { … }</i></div><div class="">What I think would be simpler and more convenient would be something like the following:</div></div><div class=""><i class="">for i in 1 … 7 step 2 { … } . </i>Another option would be <i class="">for i in 1 … 7; 2 { … }</i></div><div class="">The keyword ‚step‘ in this context clearly corresponds to the step of the range to create or to iterate over.</div><div class=""><br class=""></div><div class="">Essentially this is a syntactic sugar that makes it easy to create ranges with a step ≠ 1. What do you think?</div></body></html>