<div dir="ltr">Good idea to add <span style="font-size:12.8px">`seconds`/`days`/`solarMonths`</span><span style="font-size:12.8px">/`lunarMonths`/etc. views that are Strideable</span></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"> -- Howard.<br></div></div>
<br><div class="gmail_quote">On 30 March 2016 at 13:57, Joe Groff via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Mar 28, 2016, at 5:33 PM, Brent Royal-Gordon <<a href="mailto:brent@architechies.com">brent@architechies.com</a>> wrote:<br>
><br>
>>> Floating-point seconds (as NSTimeIntervals) are the natural Strideable.Stride, but it's not particularly clear to me that you want 1 second to be a default stride. It's the default you would guess, but it's not actually a particularly useful default.<br>
>><br>
>> Any fixed-time-period stride with dates is fraught with peril. Not every day is 24 hours, not every minute is 60 seconds, etc. Working with dates requires enough special domain knowledge that I think it'd be harmful to try to genericize numeric concepts over it.<br>
><br>
> While this is true, "ten seconds from now" is always ten seconds from now, and "seconds between date1 and date2" is always the same number of seconds. There is a basic level of time measurement and manipulation which is completely independent of time zones and calendars; that's what NSDate and NSTimeInterval represent. They are needed fairly often, and they are perfectly compatible with Strideable's semantics.<br>
<br>
Perhaps, but if you make Date strideable by seconds and automatically receive a bunch of utility methods based on that, then it becomes really tempting to abuse absolute time periods, or to accidentally misuse generic Strideable utilities instead of calendar-aware ones. We don't make String a sequence for similar reasons (though perhaps, by analogy to String, there could be `seconds`/`days`/`solarMonths`/`lunarMonths`/etc. views that are Strideable).<br>
<br>
-Joe<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div><br></div>