[squeak-dev] [Chronology] Is this a bug or a feature?

David T. Lewis lewis at mail.msen.com
Sun Jun 21 17:41:06 UTC 2009


DateAndTime fromSeconds: 0.5 ==> walkback

Prior to Mantis 4669 (which is now included in Squeak 3.10.2) the argument
to #fromSeconds: could be a non-integer value, but now it is required to be
an integer.

Is this a bug or a feature? I have relied on the original behavior in
my TimeZoneDatabase package, because in this context I was expecting
"seconds" to represent elapsed time since the epoch. However, it is
also quite common to treat "seconds" as integer numbers in other contexts,
so I don't know if my expectation was appropriate.

I took a look at a Squeak 3.6 image (prior to the addition of class
DateAndTime), and we have this:

   Time dateAndTimeFromSeconds: 0.5 ==> #(1 January 1901 12:00:00.5 am)
   Time fromSeconds: 0.5 ==> 12:00:00.5 am

But in later Squeaks with Chronology, we have:

   Time fromSeconds: 0.5 ==> 12:00:00 am

So I am inclined to think that the original Squeaky behavior implies
that #fromSeconds: should accept non-integer numbers, in which case the
walkback in DateAndTime class>>fromSeconds: would be a bug.

Opinions?

Dave




More information about the Squeak-dev mailing list