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

davesweeris at mac.com davesweeris at mac.com
Thu Apr 7 20:28:57 CDT 2016


At the risk of asking one of those newbie questions, why bother with StrideTo and StrideThrough? Isn't a Generator or Array more to the point?
> On Apr 7, 2016, at 5:59 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> I'm confused. There is an instance owning the start and end. It's called StrideTo or StrideThrough, conforms to Sequence (with a FIXME comment that it should conform to Collection) and is distinct from Range and from the Strideable bounds themselves. Is that different from what you're describing?
> 
> Yes, it is different. StrideTo and StrideThrough represent the sequence resulting from the striding operation. If there was only one of them, you would probably call it StrideSequence. They are the *result* of the `stride` function or `striding` method.

- Dave Sweeris


More information about the swift-evolution mailing list