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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tomas Volf <~@wolfsden.cz>
Subject: bug#74840: closed (Re: bug#74840: [PATCH] doc: srfi-19: Use `day'
 instead of `date' for `make-date'.)
Date: Sun, 22 Dec 2024 21:37:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

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 74840 <at> debbugs.gnu.org.

-- 
74840: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74840
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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!

[Message part 3 (message/rfc822, inline)]
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




This bug report was last modified 200 days ago.

Previous Next


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