on Wed Apr 06 2016, Milos Rankovic <milos-AT-milos-and-slavica.net> wrote:

>     On 6 Apr 2016, at 18:57, Xiaodi Wu via swift-evolution
>     <swift-evolution@swift.org> wrote:
>
>     Meanwhile, I was trying to talk about something like `stride(from: 200, 
> to:
>     0, by: -2)`, which is easily expressed today but isn't straightforward at
>     all to preserve with only ranges.
>
> Precisely because the free function is also range-free, the sign of the step
> need not repeat the direction intent which is already indicated with `from: 
> 200,
> to: 0`. In other words, I think this is much more intuitive:
>
> `stride(from: 200, to: 0, by: 2)`

But it leaves the “does it include 0?” question less clear than
something involving 0..<200 would.

-- 
Dave
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to