unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#74840: [PATCH] doc: srfi-19: Use `day' instead of `date' for `make-date'.
@ 2024-12-12 20:35 Tomas Volf
  0 siblings, 0 replies; only message in thread
From: Tomas Volf @ 2024-12-12 20:35 UTC (permalink / raw)
  To: 74840; +Cc: Tomas Volf

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






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-12 20:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 20:35 bug#74840: [PATCH] doc: srfi-19: Use `day' instead of `date' for `make-date' Tomas Volf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).