[squeak-dev] Explorer / Inspector bug?

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Mar 9 13:23:54 UTC 2021


+1 for preventing "2 second" from answering "1 second", too confusing.


-1 for answering "2 seconds" for "2 second", that would be very ambiguous language and grammatically incorrect. :-)


I think we should either go with an assertion (self assert: self = 1) or deprecate the singular selectors altogether.


Best,

Christoph

<http://www.hpi.de/>
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Chris Muller <asqueaker at gmail.com>
Gesendet: Dienstag, 9. März 2021 05:53:10
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] Explorer / Inspector bug?

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/20210309/b7cc3f60/attachment.html>


More information about the Squeak-dev mailing list