[squeak-dev] Explorer / Inspector bug?

Chris Muller asqueaker at gmail.com
Tue Mar 9 04:53:10 UTC 2021


>
> My expectation would be that #second, #minute, #hour etc would
> be syntactic sugar. And I certainly would not expect "5 second"
> to mean one second duration.
>
> I note that we have several methods like this (second, minute, hour...)
> and they have Brent Pinkney's (brp) initials since 2004. I don't know
> if anyone depends on that existing behavior.
>

That's correct.  Brent adopted those methods from my MaTimeObjects package
(which is still installable from SqueakMap), although in my version it
didn't even account for the sign, it was always just ^ 1 second, regardless
of the receiver.  I agree they should just be synonyms.


> Off topic, but there are other problems with these duration methods.
> They are defined in Number but round the duration magnitudes to
> whole seconds.


Where do you see that?  I just tried "1.5 hours" and it worked...


> And durations for 1 day or 1 week are undefinable
> due to daylight savings transitions and occasional leap seconds.


True, from a literal sense, but by that assessment we would have similar
"problems" with ChronologyConstants' DaysInMonth, MicrosecondsInDay,
OneDay, SecondsInDay, SecondsInHour, and SecondsInMinute.  All are useful,
nonetheless.

 - Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210308/9d6619e7/attachment.html>


More information about the Squeak-dev mailing list