From: David V. H. <dva...@cs...> - 2005-07-19 14:29:53
|
Noel Welsh wrote: > Thanks for the bug report. It would be helpful it you > could give the expected behaviour as well -- I can't keep > up-to-date with all Schematics projects. The description of "~f" is: "seconds+fractional seconds, using locale's decimal separator (e.g. 5.2)." There is no specification of the precision of the fractional seconds, so it seems the easiest implementation is to do the following, ie use all 9 digits available: (string-append (string->number (date-seconds d)) (locale-separator) (string-pad (string->number (date-nanoseconds d)) 9 #\0)) But any of the following would be fine according to the SRFI, as far as I can tell (assuming the locale decimal separator is "."): (define d (time-utc->date (make-time time-utc 5290000 0))) (date->string d "~f") => "0.5" "0.53" "0.529" "0.5290" "0.52900" ... PLT gives: (date->string d "~f") => "00.01-53-1" However, there are numerous other problems with the SRFI reference implementation which have leaked over into the PLT version. I'm going to rewrite it from scratch in hopes of fixing it once and for all, so don't worry about fixing this particular bug for the moment. > PS: I'm about to commit your SRFI 60 impl to Schematics > CVS. Thanks. David |