[swift-evolution] [Draft]: Introducing a striding(by:) method on 3.0 ranges

Dave Abrahams dabrahams at apple.com
Tue Apr 26 16:08:21 CDT 2016

on Mon Apr 25 2016, Erica Sadun <swift-evolution at swift.org> wrote:

> On Apr 25, 2016, at 7:15 PM, Xiaodi Wu via swift-evolution
> <swift-evolution at swift.org> wrote:
>     Yup, we're going to try to touch base, the authors of the current draft that
>     is, sometime this week. More to come, hopefully.
>     On Mon, Apr 25, 2016 at 8:13 PM, Dave Abrahams via swift-evolution
>     <swift-evolution at swift.org> wrote:
>         After some reflection, I don't really want to see a construct like #3 in
>         the standard library, and Chris has clarified for me that the standard
>         library doesn't need to solve the migration problems created by the
>         removal of C-style “for” loops. So, if I have inadvertently killed
>         progress on this proposal by bringing it up, please allow me to retract
>         item 3 above.
> * Strides break down into: walks along the integer number line and walks along
> the floating
> point number line. We need to fix the math

There are walks along countable sets (for example, the set of Ints
bounded by two UnsafePointer<Int>s) and walks along uncountable sets
(for example, the rational numbers between 0 and 1).

> * For in need to work for collections, integer ranges, and strides for basic
> iteration.
> * Advanced `for` work is already addressed with mapping and Kevin Ballard's
> proposed iterate and takeWhile
> * Everyone but me has been traveling so getting things together has been a
> little hard.
> * I have been on Nate's case a lot about what collections, strides, sequences,
> etc mean and should be named.

Thanks for the update.  FWIW I don't expect anything of anyone; I just
wanted to let everybody involved know that it could still get fixed for
Swift 3 but we'll need to move fast.



More information about the swift-evolution mailing list