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

Dave Abrahams dabrahams at apple.com
Fri Mar 25 11:19:05 CDT 2016


on Thu Mar 24 2016, Brent Royal-Gordon <swift-evolution at swift.org> wrote:

>> That
>>  would imply that floating types should not conform to Strideable,
>>  which raises the question of whether Strideable should be folded into
>>  the Integer protocol.
>
> Personally, I get a lot of mileage out of conforming NSDate to
> Strideable. 

I just recalled that Unsafe[Mutable]Pointers are also Strideable.  So
Strideable stays.

Question: by what unit should

        for d in d0...d2 {}

be iterating?  Or should it be disallowed without a .striding(by: )?

If the latter, NSDate might fall into the same bucket as floating types.

> (Although obviously it ought to be using a float-friendly
> Strideable.)

-- 
Dave



More information about the swift-evolution mailing list