on Wed Apr 06 2016, Erica Sadun <swift-evolution@swift.org> wrote:

>> On Apr 6, 2016, at 2:17 PM, Xiaodi Wu <xiaodi...@gmail.com> wrote:
>> Prohibiting StrideTo with floating-point ranges altogether would be
>> distressing. IMO, it's plenty distressing that backwards
>> floating-point StrideTo as it currently exists might go away.
>
> I wouldn't suggest doing so. I'm just saying that for a half-open interval, 
> there is no max value
> so it makes no sense mathematically to have a first value and a
> negative step. 

I don't agree.  It seems to me that striding downwards over a half-open
range r should always begin with r.upperBound - s (modulo any necessary
adjustments to avoid FP error), where -s is the stride amount.  Why is
that mathematical nonsense?

Another point to consider: striding is also a sensible operation over
collections, and some ranges are collections.  The stride semantics must
coincide in those cases.  I expect that constraint narrows down the
reasonable semantic choices considerably.

> You're not so restricted with:
>
> * positive steps
> * closed intervals
>
> -- E
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution@swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-- 
Dave

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

Reply via email to