[BUG]? Timespan>>end
Avi Bryant
avi at beta4.com
Sun Feb 22 02:52:44 UTC 2004
While we're talking about Chronology:
I found it very odd that the following assertion does not hold:
|x y|
x := self someDateAndTime.
y := self someOtherDateAndTime.
span := Timespan starting: x ending: y.
self assert: span end = y.
Instead, #end returns a DateAndTime that is one nanosecond before y.
Now, I understand the intent here, but given the method names it's
counter intuitive, and in practice it means that I never use #end but
instead use "span next start", which I have found gives me the value I
was expecting. Maybe it's just me, but I prefer to (for example)
print timespans as "1:00 pm - 2:00 pm" rather than "1:00 pm -
1:59:59.999999999 pm".
Thoughts?
Avi
More information about the Squeak-dev
mailing list
|