<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 Mar 8, 2016, at 11:13 AM, Maximilian Hünenberger via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Actually you cannot use the global stride function anymore.<br class=""></div></div></blockquote><div><br class=""></div><div><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0006-apply-api-guidelines-to-the-standard-library.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0006-apply-api-guidelines-to-the-standard-library.md</a></div><div><br class=""></div><div><pre style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; padding: 16px; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; word-break: normal; color: rgb(51, 51, 51);" class=""> extension Strideable {
<span class="pl-md" style="box-sizing: border-box; background-color: rgb(255, 236, 236); color: rgb(189, 44, 0);">-  public func stride(to end: Self, by stride: Stride) -&gt; StrideTo&lt;Self&gt;</span>
 }
<span class="pl-mi1" style="box-sizing: border-box; background-color: rgb(234, 255, 234); color: rgb(85, 165, 50);">+public func stride&lt;T : Strideable&gt;(from start: T, to end: T, by stride: T.Stride) -&gt; StrideTo&lt;T&gt;</span>

 extension Strideable {
<span class="pl-md" style="box-sizing: border-box; background-color: rgb(255, 236, 236); color: rgb(189, 44, 0);">-  public func stride(through end: Self, by stride: Stride) -&gt; StrideThrough&lt;Self&gt;</span>
 }
<span class="pl-mi1" style="box-sizing: border-box; background-color: rgb(234, 255, 234); color: rgb(85, 165, 50);">+public func stride&lt;T : Strideable&gt;(from start: T, through end: T, by stride: T.Stride) -&gt; StrideThrough&lt;T&gt;</span>
</pre><div class=""><span class="pl-mi1" style="box-sizing: border-box; background-color: rgb(234, 255, 234); color: rgb(85, 165, 50);"><br class=""></span></div></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">I thought a method on "Range" which returns a stride would be easier to grasp:<br class=""><br class="">for x in 0.stride(to: 0.5, by: 0.03) { ... }<br class=""><br class="">// much faster to predict what is does even though it is less clear to a beginner<br class="">for x in (0 ... 0.5).by(0.03) { ... }<br class=""><br class="">- Maximilian<br class=""><br class=""><blockquote type="cite" class="">Am 08.03.2016 um 18:56 schrieb Антон Жилин &lt;<a href="mailto:antonyzhilin@gmail.com" class="">antonyzhilin@gmail.com</a>&gt;:<br class=""><br class="">It's already possible:<br class=""><br class="">for d in stride(from: 0, to: 5, by: 0.3) {<br class="">}<br class=""><br class="">Absolutely readable (despite all efforts to break it).<br class="">And I would passionately hate the special syntax for floating-point loops in Swift.<br class=""></blockquote>_______________________________________________<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></div></blockquote></div><br class=""></body></html>