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

Erica Sadun erica at ericasadun.com
Fri Apr 8 13:03:33 CDT 2016


> On Apr 6, 2016, at 3:32 PM, Dave Abrahams <dabrahams at apple.com> wrote:
> 
> 
> on Wed Apr 06 2016, Erica Sadun <erica-AT-ericasadun.com> wrote:
> 
>>    On Apr 6, 2016, at 3:25 PM, Dave Abrahams <dabrahams at apple.com> wrote:
>> 
>>    These all look reasonable to me.
>> 
>>        Lastly, if you want the positive stride reversed, you'd do just that:
>> 
>>        (0 ... 9).striding(by: 2).reverse() == [8, 6, 4, 2, 0]
>> 
>>    Also reasonable.
>> 
>>    -- 
>>    Dave
>> 
>> Unless there's a compelling reason to fight here, it looks like the
>> opinion against where I'm standing is pretty overwhelming at least in
>> this subgroup. To simplify things going forward (and to avoid compiler
>> warnings, which as Dave A points out is probably an indication of bad
>> design more than bad users), I'm willing to adopt in as well.
> 
> Thanks.  In that case, I suggest that we entertain two separate
> proposals:
> 
> 1. add the .striding(by: n) method.
> 2. add the other range operators.
> 
> Though they both have obvious benefits, I expect #1 is a much easier
> sell than #2, which is one good reason to separate them.
> 
> -- 
> Dave

I may have misunderstood the intent so I want to clarify: Dave, you'd like to push on these
now (starting with #1) and not wait for the rest of the Range stuff to come online, right?

-- E


More information about the swift-evolution mailing list