Subject: bug#26329: closed (Re: bug#26329: monotonic time not supplied by current-time)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 19 Apr 2017 13:11:02 +0000

Your bug report

#26329: monotonic time not supplied by current-time

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
26329: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26329
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#26329: monotonic time not supplied by current-time
From: Andy Wingo <[email-masked]>
To: Zefram <[email-masked]>
Cc: [email-masked]
Date: Wed, 19 Apr 2017 15:10:15 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On Sat 01 Apr 2017 13:18, Zefram <[email-masked]> writes:

> The SRFI-19 current-time function can return several flavours of the
> current time:
>
> scheme@(guile-user)> (use-modules (srfi srfi-19))
> scheme@(guile-user)> (current-time time-utc)
> $1 = #<time type: time-utc nanosecond: 727666000 second: 1491045256>
> scheme@(guile-user)> (current-time time-tai)
> $2 = #<time type: time-tai nanosecond: 414752000 second: 1491045294>
> scheme@(guile-user)> (current-time time-monotonic)
> $3 = #<time type: time-tai nanosecond: 814494000 second: 1491045297>
>
> The last of these three is erroneous: a time structure of type
> time-monotonic was requested and must be returned, but instead the
> type is time-tai.

Thanks for the report; fixed.  Patches welcome too.

Andy

Subject: monotonic time not supplied by current-time
From: Zefram <[email-masked]>
To: [email-masked]
Date: Sat, 1 Apr 2017 12:18:38 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

The SRFI-19 current-time function can return several flavours of the
current time:

scheme@(guile-user)> (use-modules (srfi srfi-19))
scheme@(guile-user)> (current-time time-utc)
$1 = #<time type: time-utc nanosecond: 727666000 second: 1491045256>
scheme@(guile-user)> (current-time time-tai)
$2 = #<time type: time-tai nanosecond: 414752000 second: 1491045294>
scheme@(guile-user)> (current-time time-monotonic)
$3 = #<time type: time-tai nanosecond: 814494000 second: 1491045297>

The last of these three is erroneous: a time structure of type
time-monotonic was requested and must be returned, but instead the
type is time-tai.  Although the implementation gives these two time
types numerically identical behaviour, it does treat them as nominally
distinct in other operations:

scheme@(guile-user)> (eqv? time-tai time-monotonic)
$4 = #f
scheme@(guile-user)> (julian-day->time-tai 2450000)
$5 = #<time type: time-tai nanosecond: 0 second: 813240029>
scheme@(guile-user)> (julian-day->time-monotonic 2450000)
$6 = #<time type: time-monotonic nanosecond: 0 second: 813240029>

-zefram