Relatedly, while you're tackling this big revision:<br><br>I've tried to play around with what it would take to write a generic non-error-accumulating striding method, and afaict, it would be enormously cleaner if Strideable types are guaranteed to have + and * (well, Strideable.Stride needs *, to be more accurate), since the iterator needs to be able to compute end = start + iteration * stride. Is that going to be exposed somewhere in the cascade of numeric protocols that culminate in Strideable?<br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 28, 2016 at 7:45 PM Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
on Mon Mar 28 2016, Dave Abrahams <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
<br>
> on Mon Mar 28 2016, Erica Sadun <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
><br>
>>> On Mar 28, 2016, at 3:54 PM, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>>><br>
>>><br>
>>> on Mon Mar 28 2016, Erica Sadun <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>>><br>
>><br>
>>>>> On Mar 28, 2016, at 3:25 PM, Dave Abrahams via swift-evolution<br>
>>>>> <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>>>>><br>
>>>>><br>
>>>>> on Mon Mar 28 2016, Xiaodi Wu<br>
>>>><br>
>>>>> <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
>>>>> <mailto:<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>>><br>
>>>>> wrote:<br>
>>>>><br>
>>>>>> Right, Countable could refine Strideable. I'm no expert on this, but<br>
>>>>>> some cursory reading suggests that the analogous feature in C++ simply<br>
>>>>>> requires the type to have operator++ defined. Obviously, that won't<br>
>>>>>> work for Swift 3.0...<br>
>>>>><br>
>>>>> Hmm, instead of defining a new protocol (Countable), what if we just use<br>
>>>>> “Strideable where Stride : Integer” as a constraint?<br>
>>>><br>
>>>> I like a differentiation between continuous and discrete things<br>
>>>> although both can have ranges, membership, fences,<br>
>>>> and a way to stride through them<br>
>>><br>
>>> Strideable where Stride : Integer expresses just exactly that. Now if I<br>
>>> could only get the type-checker to cooperate...<br>
>><br>
>> I am ridiculously excited about what you're doing there.<br>
>> Looking forward to beautiful floating point strides if for no<br>
>> other reason than I can point out how well they work for math<br>
>> in comparison to traditional for;;loops, so maybe people will<br>
>> stop burning semicolons on my lawn.<br>
><br>
> The basics:<br>
> <a href="https://github.com/apple/swift/commit/a5c3c63c3d5d940f729c23aab342ea4d270d264a" rel="noreferrer" target="_blank">https://github.com/apple/swift/commit/a5c3c63c3d5d940f729c23aab342ea4d270d264a</a><br>
<br>
Hi Erica,<br>
<br>
After some consideration, while I want to see the smart<br>
(x..<y).striding(by: z) stuff happen too, it's somewhat incidental to<br>
the (already massive) project we're undertaking in this branch. Would<br>
you like to take on the implementation and/or proposal? I'd be happy to<br>
provide guidance.<br>
<br>
--<br>
Dave<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>