GNU bug report logs - #74840
[PATCH] doc: srfi-19: Use `day' instead of `date' for `make-date'.

Previous Next

Package: guile;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Thu, 12 Dec 2024 20:36:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 74840 in the body.
You can then email your comments to 74840 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#74840; Package guile. (Thu, 12 Dec 2024 20:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Thu, 12 Dec 2024 20:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: bug-guile <at> gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [PATCH] doc: srfi-19: Use `day' instead of `date' for `make-date'.
Date: Thu, 12 Dec 2024 21:35:00 +0100
Looking at the SRFI-19 specification, the argument is called `day', not
`date'.  Even the accessor is called `date-day'.  So adjust the
documentation to match.

Also adjust the (web http) module, which was using `date' as well.

* doc/ref/srfi-modules.texi (SRFI-19 Date): Use `day' instead of `date'.
* module/web/http.scm (parse-rfc-822-date, parse-rfc-850-date)
(parse-asctime-date): Same.
---
 doc/ref/srfi-modules.texi |  2 +-
 module/web/http.scm       | 24 ++++++++++++------------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index 4ccc27a7b..edfeca313 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -2661,7 +2661,7 @@ each context, and apply non-SRFI-19 facilities to convert where necessary.
 Return @code{#t} if @var{obj} is a date object, or @code{#f} if not.
 @end defun
 
-@defun make-date nsecs seconds minutes hours date month year zone-offset
+@defun make-date nsecs seconds minutes hours day month year zone-offset
 Create a new date object.
 @c
 @c  FIXME: What can we say about the ranges of the values.  The
diff --git a/module/web/http.scm b/module/web/http.scm
index 24a4312b5..b65fa91c1 100644
--- a/module/web/http.scm
+++ b/module/web/http.scm
@@ -742,40 +742,40 @@ as an ordered alist."
 (define (parse-rfc-822-date str space zone-offset)
   ;; We could verify the day of the week but we don't.
   (cond ((string-match? (substring str 0 space) "aaa, dd aaa dddd dd:dd:dd")
-         (let ((date (parse-non-negative-integer str 5 7))
+         (let ((day (parse-non-negative-integer str 5 7))
                (month (parse-month str 8 11))
                (year (parse-non-negative-integer str 12 16))
                (hour (parse-non-negative-integer str 17 19))
                (minute (parse-non-negative-integer str 20 22))
                (second (parse-non-negative-integer str 23 25)))
-           (make-date 0 second minute hour date month year zone-offset)))
+           (make-date 0 second minute hour day month year zone-offset)))
         ((string-match? (substring str 0 space) "aaa, d aaa dddd dd:dd:dd")
-         (let ((date (parse-non-negative-integer str 5 6))
+         (let ((day (parse-non-negative-integer str 5 6))
                (month (parse-month str 7 10))
                (year (parse-non-negative-integer str 11 15))
                (hour (parse-non-negative-integer str 16 18))
                (minute (parse-non-negative-integer str 19 21))
                (second (parse-non-negative-integer str 22 24)))
-           (make-date 0 second minute hour date month year zone-offset)))
+           (make-date 0 second minute hour day month year zone-offset)))
 
         ;; The next two clauses match dates that have a space instead of
         ;; a leading zero for hours, like " 8:49:37".
         ((string-match? (substring str 0 space) "aaa, dd aaa dddd  d:dd:dd")
-         (let ((date (parse-non-negative-integer str 5 7))
+         (let ((day (parse-non-negative-integer str 5 7))
                (month (parse-month str 8 11))
                (year (parse-non-negative-integer str 12 16))
                (hour (parse-non-negative-integer str 18 19))
                (minute (parse-non-negative-integer str 20 22))
                (second (parse-non-negative-integer str 23 25)))
-           (make-date 0 second minute hour date month year zone-offset)))
+           (make-date 0 second minute hour day month year zone-offset)))
         ((string-match? (substring str 0 space) "aaa, d aaa dddd  d:dd:dd")
-         (let ((date (parse-non-negative-integer str 5 6))
+         (let ((day (parse-non-negative-integer str 5 6))
                (month (parse-month str 7 10))
                (year (parse-non-negative-integer str 11 15))
                (hour (parse-non-negative-integer str 17 18))
                (minute (parse-non-negative-integer str 19 21))
                (second (parse-non-negative-integer str 22 24)))
-           (make-date 0 second minute hour date month year zone-offset)))
+           (make-date 0 second minute hour day month year zone-offset)))
 
         (else
          (bad-header 'date str)         ; prevent tail call
@@ -790,13 +790,13 @@ as an ordered alist."
   (let ((tail (substring str (1+ comma) space)))
     (unless (string-match? tail " dd-aaa-dd dd:dd:dd")
       (bad-header 'date str))
-    (let ((date (parse-non-negative-integer tail 1 3))
+    (let ((day (parse-non-negative-integer tail 1 3))
           (month (parse-month tail 4 7))
           (year (parse-non-negative-integer tail 8 10))
           (hour (parse-non-negative-integer tail 11 13))
           (minute (parse-non-negative-integer tail 14 16))
           (second (parse-non-negative-integer tail 17 19)))
-      (make-date 0 second minute hour date month
+      (make-date 0 second minute hour day month
                  (let* ((now (date-year (current-date)))
                         (then (+ now year (- (modulo now 100)))))
                    (cond ((< (+ then 50) now) (+ then 100))
@@ -811,7 +811,7 @@ as an ordered alist."
 (define (parse-asctime-date str)
   (unless (string-match? str "aaa aaa .d dd:dd:dd dddd")
     (bad-header 'date str))
-  (let ((date (parse-non-negative-integer
+  (let ((day (parse-non-negative-integer
                str
                (if (eqv? (string-ref str 8) #\space) 9 8)
                10))
@@ -820,7 +820,7 @@ as an ordered alist."
         (hour (parse-non-negative-integer str 11 13))
         (minute (parse-non-negative-integer str 14 16))
         (second (parse-non-negative-integer str 17 19)))
-    (make-date 0 second minute hour date month year 0)))
+    (make-date 0 second minute hour day month year 0)))
 
 ;; Convert all date values to GMT time zone, as per RFC 2616 appendix C.
 (define (normalize-date date)
-- 
2.46.0





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 22 Dec 2024 21:37:02 GMT) Full text and rfc822 format available.

Notification sent to Tomas Volf <~@wolfsden.cz>:
bug acknowledged by developer. (Sun, 22 Dec 2024 21:37:02 GMT) Full text and rfc822 format available.

Message #10 received at 74840-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: 74840-done <at> debbugs.gnu.org
Subject: Re: bug#74840: [PATCH] doc: srfi-19: Use `day' instead of `date'
 for `make-date'.
Date: Sun, 22 Dec 2024 22:36:13 +0100
Tomas Volf <~@wolfsden.cz> skribis:

> Looking at the SRFI-19 specification, the argument is called `day', not
> `date'.  Even the accessor is called `date-day'.  So adjust the
> documentation to match.
>
> Also adjust the (web http) module, which was using `date' as well.
>
> * doc/ref/srfi-modules.texi (SRFI-19 Date): Use `day' instead of `date'.
> * module/web/http.scm (parse-rfc-822-date, parse-rfc-850-date)
> (parse-asctime-date): Same.

Applied, thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Jan 2025 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.