[squeak-dev] Re: Date[And]Time fractional seconds printing

Eliot Miranda eliot.miranda at gmail.com
Sun Aug 29 03:38:33 UTC 2010


On Sat, Aug 28, 2010 at 7:18 PM, Andreas Raab <andreas.raab at gmx.de> wrote:

> Hi David -
>
>
> On 8/28/2010 9:55 AM, David T. Lewis wrote:
>
>> I don't like the idea of having #now disregard fractional seconds.
>> Effectively that means that a request for the current time gets
>> automatically rounded or truncated to the nearest second, which is
>> just plain wrong.
>>
>
> I see your point, but I disagree. To me this is a classic question of "what
> should the default be?". And the default should be what most users of #now
> expect. From the code that I've looked at, I still haven't found any place
> that would benefit from fractional seconds. If that is true, then I think
> the default should be whole seconds, with a protocol allowing to ask for
> fractional seconds if that case ever comes up. If you know of any examples
> in the current system that benefit from fractional seconds in #now I'd
> really love to see them.
>
> BTW, does anyone know what the result of "Date[And]Time now" is in other
> systems? What do VW, GST, and others return? Whole seconds or fractional?
>

VisualWorks answers whole seconds (as did Smalltalk-80 v2):

| s t c |
c := 0.
t := Time now.
[(s := Time now) = t] whileTrue.
[(t := Time now) = s] whileTrue: [c := c + 1].
Array with: s with: t with: c #(8:37:52 PM 8:37:53 PM 79465)


>
> Cheers,
>  - Andreas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100828/ef94f280/attachment.htm


More information about the Squeak-dev mailing list