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

Brent Royal-Gordon brent at architechies.com
Thu Apr 7 17:59:14 CDT 2016


> 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.

What I'm talking about is a single instance which represents what you are striding *over*, but *not* the length of the stride. It is an *input* to the `stride` function or `striding` method.

Does that make sense?

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list