From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Zefram Newsgroups: gmane.lisp.guile.bugs Subject: bug#26149: SRFI-19 doc erroneously warns about Gregorian reform Date: Wed, 19 Apr 2017 17:11:39 +0100 Message-ID: <20170419161139.GA16454@fysh.org> References: <20170317235307.GF6518@fysh.org> <878tmwmpam.fsf@igalia.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vkogqOf2sHV7VnPd" X-Trace: blaine.gmane.org 1492618336 12553 195.159.176.226 (19 Apr 2017 16:12:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Apr 2017 16:12:16 +0000 (UTC) To: 26149@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Apr 19 18:12:10 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0sDC-000375-O2 for guile-bugs@m.gmane.org; Wed, 19 Apr 2017 18:12:10 +0200 Original-Received: from localhost ([::1]:49258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0sDI-0005hF-L9 for guile-bugs@m.gmane.org; Wed, 19 Apr 2017 12:12:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0sDA-0005fy-8w for bug-guile@gnu.org; Wed, 19 Apr 2017 12:12:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0sD5-0007ta-9I for bug-guile@gnu.org; Wed, 19 Apr 2017 12:12:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0sD5-0007tO-2G for bug-guile@gnu.org; Wed, 19 Apr 2017 12:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d0sD4-0004PI-Fj for bug-guile@gnu.org; Wed, 19 Apr 2017 12:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Zefram Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 19 Apr 2017 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26149 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 26149-submit@debbugs.gnu.org id=B26149.149261830416916 (code B ref 26149); Wed, 19 Apr 2017 16:12:02 +0000 Original-Received: (at 26149) by debbugs.gnu.org; 19 Apr 2017 16:11:44 +0000 Original-Received: from localhost ([127.0.0.1]:57159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0sCm-0004Ol-4r for submit@debbugs.gnu.org; Wed, 19 Apr 2017 12:11:44 -0400 Original-Received: from river.fysh.org ([87.98.248.19]:34864 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0sCk-0004Od-FM for 26149@debbugs.gnu.org; Wed, 19 Apr 2017 12:11:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fysh.org; s=20170316; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=6XyUtBrLehVwBX8e+1ziJfcNxrlXRMBFKMTtFnSFL8c=; b=KAHphp+aB0jCn/WpGCNRN67CtjIGu7Y2/WKJUoHo3CnkUJOyCXvgehRqBU6NhTnlxmDGNrygXeye/EIMeHFe2o9+vWDpbTRc1sduPp8i28vbqnGsW6e5Ps5LsE+1BxG7PYywMBoMxO6K1QZa/QWHLjSVFWigduyZs6SW5KmIrzI=; Original-Received: from zefram by river.fysh.org with local (Exim 4.84_2 #1 (Debian)) id 1d0sCh-000520-CF; Wed, 19 Apr 2017 17:11:39 +0100 Content-Disposition: inline In-Reply-To: <878tmwmpam.fsf@igalia.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8762 Archived-At: --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Andy Wingo wrote: >This makes sense to me, FWIW. Patch attached. -zefram --vkogqOf2sHV7VnPd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-correct-note-about-Gregorian-reform-in-SRFI-19.patch" >From 444703940983d559935c4dd2a2c89d7888c67119 Mon Sep 17 00:00:00 2001 From: Zefram 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. --- doc/ref/srfi-modules.texi | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi index 95509b2..3d44156 100644 --- a/doc/ref/srfi-modules.texi +++ b/doc/ref/srfi-modules.texi @@ -2383,17 +2383,6 @@ functions and variables described here are provided by (use-modules (srfi srfi-19)) @end example -@strong{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. - @menu * SRFI-19 Introduction:: * SRFI-19 Time:: @@ -2593,6 +2582,16 @@ The fields are year, month, day, hour, minute, second, nanoseconds and timezone. A date object is immutable, its fields can be read but they cannot be modified once the object is created. +Historically, the Gregorian calendar was only used from the latter part +of the year 1582 onwards, and not until even later in many countries. +Prior to that most countries used the Julian calendar. SRFI-19 does +not deal with the Julian calendar at all, and so does not reflect this +historical calendar reform. Instead it projects the Gregorian calendar +back proleptically as far as necessary. When dealing with historical +data, especially prior to the British Empire's adoption of the Gregorian +calendar in 1752, one should be mindful of which calendar is used in +each context, and apply non-SRFI-19 facilities to convert where necessary. + @defun date? obj Return @code{#t} if @var{obj} is a date object, or @code{#f} if not. @end defun -- 2.1.4 --vkogqOf2sHV7VnPd--