[squeak-dev] Printing nanos in Time print24

David T. Lewis lewis at mail.msen.com
Tue Oct 14 03:42:26 UTC 2014


On Mon, Oct 13, 2014 at 11:07:18PM -0400, David T. Lewis wrote:
> On Thu, Oct 09, 2014 at 12:30:30PM +0200, Stephan Eggermont wrote:
> > Since 2009-6-25 (dtl) 
> > Time>>#print24:showSeconds:on: 
> > prints nanos. This contradicts the class and 
> > method comments. The tests carefully 
> > avoid the issue. 
> > 
> > Why was this behavior introduced,
> > and can it safely be improved?
> > It occurs in both Squeak and Pharo (issue 14198)
> 
> Stephan,
> 
> I do not know the reason, but I see that the method has my initials on
> it, so I owe you a better answer.
> 

The change was introduced here:

  Name: Kernel-dtl.177
  Author: dtl
  Time: 13 July 2009, 12:08:49.002 pm
  UUID: 152a8933-6259-46cc-a118-55029e8dbb5a
  Ancestors: Kernel-dtl.176
  
  Reference Mantis 0007356: DateAndTime fromSeconds: 0.5 => walkback, broken
  since Mantis 4669
  
  Allow #fromSeconds: to accept non-integer arguments, and update Time>>printString
  to display fractional seconds for better compatibility with the original Squeak
  implementation. The expressions 'DateAndTime fromSeconds: 0.5' and 'Time
  fromSeconds: 0.5' now behave as expected.
  
  This change set fixes a limitation of #fromSeconds: that was introduced in
  Mantis 4669: [ENH] TimeForSpeed. It changes the corresponding #fromSeconds:
  and #printString for class Time to match DateAndTime and to be more compatible
  with the original Squeak implementation.

Based on this, I think that my intention at the time was to make Time>>printString
behave similarly to its original intended behavior. I am not sure if the problem
with Time>>print24:showSeconds:on: is a bug in the method comment or in its
current implementation.

Dave



More information about the Squeak-dev mailing list