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

Erica Sadun erica at ericasadun.com
Wed Apr 6 13:21:12 CDT 2016


> On Apr 6, 2016, at 12:16 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>    (0..<199).striding(by: -2)
> 
> are even or odd.

(0..<199).striding(by: -2): 0..<199 == 0...198 Even
(1..<199).striding(by: -2): 1..<199 == 1...198 Even
(0..<198).striding(by: -2): 1..<198 == 0...197 Odd
(1..<198).striding(by: -2): 1..<198 == 1...197 Odd

-- E

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160406/84fff3fd/attachment.html>


More information about the swift-evolution mailing list