[swift-evolution] Feature proposal: Range operator with step

Erica Sadun erica at ericasadun.com
Thu Mar 31 13:40:07 CDT 2016

> On Mar 31, 2016, at 12:29 PM, Stephen Canon via swift-evolution <swift-evolution at swift.org> wrote:
> I also don’t think that such a loop is particularly useful.  For floating-point types, something like stride(from: T, to: T, steps: Int) seems safer and more workable to me (this is just my immediate reaction, I haven’t thought this through in detail, and am likely to change my mind if someone makes a good case).

While I do not object to n-steps, allowing a step difference is equally important in my opinion.
"I want to sample every n deciRuncibles" versus "I want to sample 8 times between 1 deciRuncible 
and 10 deciRuncibles"

I disagree that the former is less useful than the latter.

-- E

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160331/a556ebfb/attachment.html>

More information about the swift-evolution mailing list