From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 17 21:11:13 2017 Received: (at submit) by debbugs.gnu.org; 18 Mar 2017 01:11:13 +0000 Received: from localhost ([127.0.0.1]:33074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp2tk-0007nB-QF for submit@debbugs.gnu.org; Fri, 17 Mar 2017 21:11:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp2tj-0007mw-3S for submit@debbugs.gnu.org; Fri, 17 Mar 2017 21:11:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cp2tc-0002La-KY for submit@debbugs.gnu.org; Fri, 17 Mar 2017 21:11:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50819) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cp2tc-0002LG-H7 for submit@debbugs.gnu.org; Fri, 17 Mar 2017 21:11:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cp2tb-00070l-4B for bug-guile@gnu.org; Fri, 17 Mar 2017 21:11:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cp2tZ-0002JN-Ut for bug-guile@gnu.org; Fri, 17 Mar 2017 21:11:03 -0400 Received: from river6.fysh.org ([2001:41d0:d:20da::2]:35242 helo=river.fysh.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cp2tZ-0002IL-M2 for bug-guile@gnu.org; Fri, 17 Mar 2017 21:11:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fysh.org; s=20170316; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=MZCpuVaslGTSLpZT7PoxRENWGS6HpNfJAKnRTRGZx4I=; b=IzXFiYgm7vtmBfgw8xirDPq3y9RnrVz7+L81SrwifIXBbtc3qFycdQO9FNe51KHo11kwCAYnkio5Ow7oE7yWRqNtnSdKT8f6jHQ53dmN5srKcDhuG4EcCciaSwf6GlJIIeSmxHBySLFGmZfKALUlFskNcBI7ZPyMzdjnivWRLZQ=; Received: from zefram by river.fysh.org with local (Exim 4.84_2 #1 (Debian)) id 1cp2tW-0005OE-9J; Sat, 18 Mar 2017 01:10:58 +0000 Date: Sat, 18 Mar 2017 01:10:58 +0000 From: Zefram To: bug-guile@gnu.org Subject: date-year-day screws up leap days prior to AD 1 Message-ID: <20170318011058.GG6518@fysh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) In SRFI-19, the date-year-day function is meant to return the ordinal day of the year for a date structure. This value is properly 1 for the first day of each calendar year, and on all other days 1 greater than the value for the preceding day. But the implementation occasionally has it repeat a value: scheme@(guile-user)> (use-modules (srfi srfi-19)) scheme@(guile-user)> (date-year-day (julian-day->date 1719657 0)) $1 = 59 scheme@(guile-user)> (date-year-day (julian-day->date 1719658 0)) $2 = 60 scheme@(guile-user)> (date-year-day (julian-day->date 1719659 0)) $3 = 60 and occasionally has it skip a value: scheme@(guile-user)> (date-year-day (julian-day->date 1720023 0)) $4 = 59 scheme@(guile-user)> (date-year-day (julian-day->date 1720024 0)) $5 = 61 These errors happen around the end of February in years preceding AD 1. In each leap year a value is repeated (ordinal values 1 too low from March to December), and in each year immediately following a leap year a value is skipped (ordinal values 1 too high from March to December). Looking at the code, the bug arises from confusion between astronomical year numbering (which leap-year? expects to receive) and the bizarre zero-skipping year numbering that the library uses in the date structure (which date-year-day passes, via year-day, to leap-year?). Since the subject's come up: that year numbering used in the date structures is surprising, and I'm not sure quite what to make of it. It matches AD year numbering for years AD 1 onwards, but then numbers AD 0 (1 BC) as -1, and numbers all earlier years in accordance with that. It's almost a straight linear numbering of years, except that it skips the number 0. (At least you've documented it.) This is not a convention that I've seen in real use anywhere else, and that weird exception to the linearity makes it a pain to use. It's likely to cause bugs in user code, along the lines of the library bug that I've reported above and the previously-reported bug#21903. However, I haven't reported the year numbering per se as a bug, because SRFI-19 doesn't actually say what numbering is to be used for the date-year slot. If I had implemented SRFI-19 myself, without reference to existing implementations, I would have implemented astronomical year numbering (consistent AD year numbering, extending linearly in both directions), as used in ISO 8601. This is the most conventional year numbering, and at a stretch one could read SRFI-19 as implying it, by using some AD year numbering and not saying to deviate from that scheme. But really the standard is silent on the issue. Since the signification of date-year is an interoperability issue, this silence is a problem, and it is troubling that you and I have reached different interpretations of the standard on this point. Where did you get the idea to use a non-linear year numbering? What's your opinion of SRFI-19's (lack of) text on this matter? You should consider the possibility of changing your implementation to use the conventional astronomical year numbering in this slot. -zefram From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 18 05:40:36 2017 Received: (at submit) by debbugs.gnu.org; 18 Mar 2017 09:40:36 +0000 Received: from localhost ([127.0.0.1]:33233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpAqi-0003ip-FA for submit@debbugs.gnu.org; Sat, 18 Mar 2017 05:40:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpAqg-0003ic-IQ for submit@debbugs.gnu.org; Sat, 18 Mar 2017 05:40:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpAqa-0003MF-9A for submit@debbugs.gnu.org; Sat, 18 Mar 2017 05:40:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cpAqa-0003MB-5d for submit@debbugs.gnu.org; Sat, 18 Mar 2017 05:40:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpAqY-00024I-Th for bug-guile@gnu.org; Sat, 18 Mar 2017 05:40:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpAqV-0003KH-QD for bug-guile@gnu.org; Sat, 18 Mar 2017 05:40:26 -0400 Received: from mail.tuxteam.de ([5.199.139.25]:33014 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cpAqV-0003Jy-K1 for bug-guile@gnu.org; Sat, 18 Mar 2017 05:40:23 -0400 Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1cpAqU-0002y8-1c for bug-guile@gnu.org; Sat, 18 Mar 2017 10:40:22 +0100 Date: Sat, 18 Mar 2017 10:40:22 +0100 To: bug-guile@gnu.org Subject: Re: bug#26151: date-year-day screws up leap days prior to AD 1 Message-ID: <20170318094021.GB10711@tuxteam.de> References: <20170318011058.GG6518@fysh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit In-Reply-To: <20170318011058.GG6518@fysh.org> User-Agent: Mutt/1.5.21 (2010-09-15) From: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, Mar 18, 2017 at 01:10:58AM +0000, Zefram wrote: [...] > Where did you get the idea to use a non-linear year numbering? What's > your opinion of SRFI-19's (lack of) text on this matter? You should > consider the possibility of changing your implementation to use the > conventional astronomical year numbering in this slot. It seems that there are both conventions, "with year zero" (astronomical) and "without year zero" (the more "conventional" historical usage (aka "Common Era"), see [1]. That said, these days (and ISO 8601) go by "with year zero". Therefore I'd sympathize with your tendency. Perhaps an option or a different set of functions might satisfy both camps? Definitely it needs to be documented. Regards [1] https://en.wikipedia.org/wiki/Year_zero - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAljNAIUACgkQBcgs9XrR2kZwUgCfen5ea8HCGVZzXCZd3ErwGi2V MwoAnA+0Au3tNQNiFKJ1mcsMDHl6iCeT =w9Dn -----END PGP SIGNATURE----- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 25 03:57:55 2017 Received: (at 26151) by debbugs.gnu.org; 25 Apr 2017 07:57:55 +0000 Received: from localhost ([127.0.0.1]:38787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2vMA-0002wT-W4 for submit@debbugs.gnu.org; Tue, 25 Apr 2017 03:57:55 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:64950 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2vM9-0002wL-9x for 26151@debbugs.gnu.org; Tue, 25 Apr 2017 03:57:53 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id DC11D73C12; Tue, 25 Apr 2017 03:57:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ppEjeeBDbZA0EPHUBOSa2r6GB7E=; b=vXtZ2u rFKcZm9c3JkeTjbRxIJCllYAZ0i+vBYizquEhSIKlSc5zpBeUDa/Ty9Sn6Dc1I+0 rwHrTO1CRaP/N2yVnMwA1M6faUZ2AapfZWV44DvPICYV2afBajzJa4hoZM/hrXgL pUtHqmMzPbalJjManFs32Ov36wZDeW9vPWbWc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ar4TCK4RvjqauPJLTqUYJHn5PvJuVncy 4xF2SHFNAUlp8bNKUeeaHOjSQ6TtPW5FV+jWvO5O7wwlhvPiRRsYU3QKeEl7EXt5 KcWsCLU6tVVKXENSAC1hcqOJyEtZNvGrP+OuHHA9E+omuuWxMGWFeC9R7H3uSzjb Jvyh+IdfaQs= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id D3ADB73C11; Tue, 25 Apr 2017 03:57:49 -0400 (EDT) Received: from clucks (unknown [151.127.12.20]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id C15FC73C10; Tue, 25 Apr 2017 03:57:48 -0400 (EDT) From: Andy Wingo To: Zefram Subject: Re: bug#26151: date-year-day screws up leap days prior to AD 1 References: <20170318011058.GG6518@fysh.org> Date: Tue, 25 Apr 2017 09:57:41 +0200 In-Reply-To: <20170318011058.GG6518@fysh.org> (zefram@fysh.org's message of "Sat, 18 Mar 2017 01:10:58 +0000") Message-ID: <87mvb4udfu.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: E01D83EE-298C-11E7-98E8-07D2064AB293-02397024!pb-sasl1.pobox.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 26151 Cc: 26151@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Sat 18 Mar 2017 02:10, Zefram writes: > If I had implemented SRFI-19 myself, without reference to existing > implementations, I would have implemented astronomical year numbering > (consistent AD year numbering, extending linearly in both directions), > as used in ISO 8601. This is the most conventional year numbering, > and at a stretch one could read SRFI-19 as implying it, by using some AD > year numbering and not saying to deviate from that scheme. But really the > standard is silent on the issue. Since the signification of date-year is > an interoperability issue, this silence is a problem, and it is troubling > that you and I have reached different interpretations of the standard > on this point. > > Where did you get the idea to use a non-linear year numbering? What's > your opinion of SRFI-19's (lack of) text on this matter? You should > consider the possibility of changing your implementation to use the > conventional astronomical year numbering in this slot. For what it's worth the "you" in your message refers to "hackers of yore" ;-) I mean, this code's core was last changed in 2001 by a Guile maintainer a few generations back. The fact that it's lasted this long does indicates that it's generally acceptable, but the fact that you have found so many bugs indicates that there are parts of it that aren't so good. And it's old old code that needs modernizing (proper data structures, pattern matching, and so on). What I mean to say is that if there's a more sensible thing to do, we can do it. To answer your specific question: would this be an ABI change in some way, or can we make this change in 2.2? Andy From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 21 16:39:12 2018 Received: (at 26151-done) by debbugs.gnu.org; 21 Oct 2018 20:39:12 +0000 Received: from localhost ([127.0.0.1]:34609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEKVE-00066n-0L for submit@debbugs.gnu.org; Sun, 21 Oct 2018 16:39:12 -0400 Received: from world.peace.net ([64.112.178.59]:59750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEKVC-00066c-VH for 26151-done@debbugs.gnu.org; Sun, 21 Oct 2018 16:39:11 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gEKV7-0001hq-88; Sun, 21 Oct 2018 16:39:05 -0400 From: Mark H Weaver To: Zefram Subject: Re: bug#26151: date-year-day screws up leap days prior to AD 1 References: <20170318011058.GG6518@fysh.org> Date: Sun, 21 Oct 2018 16:38:50 -0400 In-Reply-To: <20170318011058.GG6518@fysh.org> (Zefram's message of "Sat, 18 Mar 2017 01:10:58 +0000") Message-ID: <87sh0zyqzp.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 26151-done Cc: 26151-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is fixed by commit a58c7abd72648f77e4ede5f62a2c4e7969bb7f95 on the stable-2.2 branch. I'm closing this bug now, but please reopen if appropriate. Thanks! Mark From unknown Fri Jun 20 18:13:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 19 Nov 2018 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator