GNU bug report logs -
#26149
SRFI-19 doc erroneously warns about Gregorian reform
Previous Next
Reported by: Zefram <zefram <at> fysh.org>
Date: Fri, 17 Mar 2017 23:54:01 UTC
Severity: normal
Done: Andy Wingo <wingo <at> pobox.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26149 in the body.
You can then email your comments to 26149 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guile <at> gnu.org
:
bug#26149
; Package
guile
.
(Fri, 17 Mar 2017 23:54:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Zefram <zefram <at> fysh.org>
:
New bug report received and forwarded. Copy sent to
bug-guile <at> gnu.org
.
(Fri, 17 Mar 2017 23:54:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The documentation, near the start of the section on SRFI-19, says
! *Caution*: The current code in this module incorrectly extends the
! Gregorian calendar leap year rule back prior to the introduction of
! those reforms in 1582 (or the appropriate year in various countries).
! The Julian calendar was used prior to 1582, and there were 10 days
! skipped for the reform, but the code doesn't implement that.
!
! This will be fixed some time. Until then calculations for 1583
! onwards are correct, but prior to that any day/month/year and day of the
! week calculations are wrong.
The statements that the code is incorrect in this behaviour are erroneous.
SRFI-19 itself says
# A Date object, which is distinct from all existing types, represents a
# point in time as represented by the Gregorian calendar as well as by a
# time zone.
The code is thus correct in always using the Gregorian calendar in
date structures. Per ISO 8601 it is also correct in always using
the Gregorian calendar in string output in that standard's formats.
SRFI-19 isn't explicit about the calendar used as the basis for the
other string output formats, but since the formatting proceeds from a
date structure it seems implied that they should use the same basis as
the date structure. For string input it is explicit that the parseable
numeric formats correspond directly to fields of the date structure.
There is no part of SRFI-19 that looks like it is ever intended to use
the Julian calendar.
So the code should not be `fixed', and the statements about that and about
incorrectness should be removed from the documentation. It is sensible to
keep an explicit statement about the treatment of the Gregorian reform,
but the decision to use the Gregorian calendar proleptically should be
credited to SRFI-19 (the standard), not to the code.
-zefram
Information forwarded
to
bug-guile <at> gnu.org
:
bug#26149
; Package
guile
.
(Wed, 19 Apr 2017 14:44:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 26149 <at> debbugs.gnu.org (full text, mbox):
On Sat 18 Mar 2017 00:53, Zefram <zefram <at> fysh.org> writes:
> The documentation, near the start of the section on SRFI-19, says
>
> ! *Caution*: The current code in this module incorrectly extends the
> ! Gregorian calendar leap year rule back prior to the introduction of
> ! those reforms in 1582 (or the appropriate year in various countries).
> ! The Julian calendar was used prior to 1582, and there were 10 days
> ! skipped for the reform, but the code doesn't implement that.
> !
> ! This will be fixed some time. Until then calculations for 1583
> ! onwards are correct, but prior to that any day/month/year and day of the
> ! week calculations are wrong.
>
> The statements that the code is incorrect in this behaviour are erroneous.
> SRFI-19 itself says
>
> # A Date object, which is distinct from all existing types, represents a
> # point in time as represented by the Gregorian calendar as well as by a
> # time zone.
>
> The code is thus correct in always using the Gregorian calendar in
> date structures. Per ISO 8601 it is also correct in always using
> the Gregorian calendar in string output in that standard's formats.
> SRFI-19 isn't explicit about the calendar used as the basis for the
> other string output formats, but since the formatting proceeds from a
> date structure it seems implied that they should use the same basis as
> the date structure. For string input it is explicit that the parseable
> numeric formats correspond directly to fields of the date structure.
> There is no part of SRFI-19 that looks like it is ever intended to use
> the Julian calendar.
>
> So the code should not be `fixed', and the statements about that and about
> incorrectness should be removed from the documentation. It is sensible to
> keep an explicit statement about the treatment of the Gregorian reform,
> but the decision to use the Gregorian calendar proleptically should be
> credited to SRFI-19 (the standard), not to the code.
This makes sense to me, FWIW.
Andy
Information forwarded
to
bug-guile <at> gnu.org
:
bug#26149
; Package
guile
.
(Wed, 19 Apr 2017 16:12:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 26149 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Andy Wingo wrote:
>This makes sense to me, FWIW.
Patch attached.
-zefram
[0001-correct-note-about-Gregorian-reform-in-SRFI-19.patch (text/x-diff, attachment)]
Reply sent
to
Andy Wingo <wingo <at> pobox.com>
:
You have taken responsibility.
(Tue, 25 Apr 2017 07:46:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Zefram <zefram <at> fysh.org>
:
bug acknowledged by developer.
(Tue, 25 Apr 2017 07:46:03 GMT)
Full text and
rfc822 format available.
Message #16 received at 26149-done <at> debbugs.gnu.org (full text, mbox):
On Wed 19 Apr 2017 18:11, Zefram <zefram <at> fysh.org> writes:
> Andy Wingo wrote:
>>This makes sense to me, FWIW.
>
> Patch attached.
Thank you! Applied. I adapted the change log message to follow Guile
conventions; it was:
> From 444703940983d559935c4dd2a2c89d7888c67119 Mon Sep 17 00:00:00 2001
> From: Zefram <zefram <at> fysh.org>
> Date: Wed, 19 Apr 2017 17:08:30 +0100
> Subject: [PATCH] correct note about Gregorian reform in SRFI-19
>
> SRFI-19 specifies proleptic use of the Gregorian calendar, so it was
> incorrect of the documentation to describe the code as erroneous in
> doing so. Rewrite the caution more neutrally, and move it to the section
> about the "date" structure, where it seems most relevant.
As applied:
Correct note about Gregorian reform in SRFI-19
* doc/ref/srfi-modules.texi (SRFI-19): SRFI-19 specifies proleptic use
of the Gregorian calendar, so it was incorrect of the documentation to
describe the code as erroneous in doing so. Rewrite the caution more
neutrally, and move it to the section about the "date" structure, where
it seems most relevant.
Note capitalization of the summary line and an inclusion of the file and
section/function in the commit message. I know the file is redundant
but this is how we currently do it. If you use Emacs and Magit,
pressing "C" (capital) in a Magit diff will add this info to the commit
log for you.
Andy
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 23 May 2017 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 331 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.