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

Thorsten Seitz tseitz42 at icloud.com
Wed Mar 30 10:16:42 CDT 2016


+1

-Thorsten 

> Am 25.03.2016 um 17:24 schrieb Jordan Rose via swift-evolution <swift-evolution at swift.org>:
> 
> 
>> On Mar 25, 2016, at 9:19 , Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> 
>> 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.
> 
> Strong vote to require a unit here, especially given that .minutes, .hours, .days, .months, and .years are all non-uniform intervals that are nonetheless useful to stride by!
> 
> Jordan
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list