[squeak-dev] What do you expect to get from Duration>>seconds and Time>>seconds?

Ken Causey ken at kencausey.com
Sat May 10 02:09:50 UTC 2008


One of the issues reported against 3.10 is that 'Time now seconds'
returns a fraction and not an integer as it did in 3.9 (and presumably
before).  It turns out the fact that it was an integer previously was an
artifact of the fact that the clock did not provide sub-second
precision.  Now that it does it returns a fraction.  All along the
actual calculation of seconds was done in Duration>>seconds and since
2003 that calculation has taken nanoseconds into consideration and
clearly would return a fraction if nanoseconds is non-zero.

I think it's reasonable to get a fraction from Duration>>seconds since
sub-second durations are not unusual.  Maybe someone else expects to get
a 0 in that case, if so please speak up.

However what about Time>>seconds?  The ANSI protocol specifies
Duration>>seconds simply specifying that it returns a number, but there
is no specification for Time>>seconds or DateAndTime>>seconds at all.
It does however specify DateAndTime>>second though and again it only
says 'number'.  So it seems to be time to gather opinions.

Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080509/1f3b444c/attachment.pgp


More information about the Squeak-dev mailing list