[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

reference implementation bug


According to http://list.cs.brown.edu/pipermail/plt-scheme/2007-March/016761.html and http://list.cs.brown.edu/pipermail/plt-scheme/2007-March/016763.html, we found a new bug in the SRFI 19 reference implementation (that is, the PLT implementation).

According to PLT MzScheme: Language Manual:

(current-milliseconds) returns the current ``time'' in fixnum milliseconds (***possibly negative***). This time is based on a platform-specific starting date or on the machine's startup time. Since the result is a fixnum, the value increases only over a limited (though reasonably long) time.

If current-milliseconds is negative, this will definitely break.

Now I'm putting the following into PLT SVN:

(define (tm:get-time-of-day)
  (let* ([total-msecs (current-inexact-milliseconds)]
         [secs (floor (/ total-msecs 1000))]
         [msecs (floor (- total-msecs (* secs 1000)))])
    (values (inexact->exact secs) (inexact->exact msecs))))

Would SRFI-19 author please check this and provide a better accompanying implementation that works well with PLT v360?