[Top][All Lists]

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

Re: [Chicken-users] (current-seconds) returning negative values

From: Felix Winkelmann
Subject: Re: [Chicken-users] (current-seconds) returning negative values
Date: Mon, 12 Jan 2004 08:36:28 +0100
User-agent: Opera7.21/Win32 M2 build 3218

Am Sun, 11 Jan 2004 22:58:31 -0800 hat Valentyn Kamyshenko <address@hidden> geschrieben:

Urgh. Indeed. I'll change `current-seconds' to return
a floating-point number.

does it mean that it will not have a 1-sec resolution anymore?

Dammit. I stumbled over that thing again. Yes, you're right, just
changing it to a flonum won't help.
In fact for comparisons, a negative value of `(current-seconds)'
should still work. But that it's negative is still unsatisfying.

I would suggest to introduce a special function for time difference calculations instead, so that
   (time_diff (current-seconds) (file-modification-time "bla"))
would work properly.

Basically, I think it would be preferable to treat output of functions like current-seconds as a special type (which may be the unsigned integer, but is in fact of the time_t type in unix).

This may be the best solution. SRFI-18 already provides a `current-time'
procedure. We could change `file-...-time' (and perhaps some others)
to return time objects instead of seconds, together with some basic
operators (time+, time-, time>?, etc.) that can be used to perform
arithmetic and comparisons.

Would that be more satisfactory?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]