On Tue, 6 Sep 2005, Joshua Hoblitt wrote:

No, they'll notice, but the workarounds for subtractions are
well-documented.

So why is that better than making subtractions work 'as expected' and
documenting the work arounds for addition?

Because AFAICT subtractions just _cannot_ work as expected. I have yet to see anyone come up with a proposal that fully accounts for DST changes.

Anyway, your position seemed to be that they won't notice for either, and
that both should be weird ;)

My position is that you really need to put on your critical thinking hat
and think about how *wrong* it is for additions and subtractions to have
different behaviors.

Well, they don't if you use either subtract_datetime_absolute (which is seconds only) or delta_days. Both of these return durations that work regardless of issues related to DST, ordering of add/subtract operations, etc.

The more I think about this the more I'm convinced that the idea of
datetime subtraction producing something other than seconds is a
convenient fiction.  Similarly, date subtraction producing something other
than a count of days is full of potential bugs.

The whole point of DT is that it is *correct*.  We need to decide on
what the correct behavior is regardless of how painful it is to
implement on top of the Rata Die system.  It seems to me the real
question would should be answering is: is calendar math subject to DST
transitions or not?

Suggestions welcome, but I don't think you've thought of all the possible problems. The idea that DT.pm will always be correct is nice, but I don't think there is any one definition of correct in this area. I can imagine various insanely complicated attempts to make it all "just work", but I suspect they'd be a house of cards.

I will make a list of all the problems I've run across so far, along with examples that demonstrate them. Anyone who can come up with a solution that handles all of these problems is a far smarter person than I am ;)


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

Reply via email to