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

Milos Rankovic milos at milos-and-slavica.net
Tue Apr 5 15:30:31 CDT 2016


> On 5 Apr 2016, at 20:54, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> IMO this:
> 
>  (-9...0).reverse()
> 
> is better than 
> 
>  stride(from: 0, to: -10, by: -1)
> 
> What do you think?
> 
> -- 
> Dave

Are we absolutely certain that an operator could not be found such that (I use `<` and `>` here for illustrative purposes only):

    for i in 1...5 > 2 {
        i // 1, 3, 5
    }

    for i in 1...5 < 2 {
        i // 5, 3, 1
    }

milos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160405/f88ed712/attachment.html>


More information about the swift-evolution mailing list