[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1] SRFI-19: Add support for ISO 8601 zones with a colon.
From: |
Rob Browning |
Subject: |
Re: [PATCH v1] SRFI-19: Add support for ISO 8601 zones with a colon. |
Date: |
Wed, 06 Mar 2024 12:42:10 -0600 |
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:
> diff --git a/module/srfi/srfi-19.scm b/module/srfi/srfi-19.scm
> index 570f933ca..23d115926 100644
> --- a/module/srfi/srfi-19.scm
> +++ b/module/srfi/srfi-19.scm
> @@ -1271,6 +1271,11 @@
> (if (eof-object? ch)
> (time-error 'string->date 'bad-date-template-string
> (list "Invalid time zone number" ch)))
> + (if (char=? ch #\:)
> + (set! ch (read-char port))
> + (if (eof-object? ch)
> + (time-error 'string->date 'bad-date-template-string
> + (list "Invalid time zone number" ch))))
> (set! offset (+ offset (* (char->int ch)
> 10 60))))
This looks reasonable to me -- I wondered about moving the check "up
front", eliminating the need for the extra eof?, i.e.
(let ((ch (read-char port)))
(when (char=? ch #\:)
(set! ch (read-char port))
(if (eof-object? ch)
(time-error 'string->date 'bad-date-template-string
(list "Invalid time zone number" ch)))
(set! ...))
(...and (not related), I also wondered about making some of the error
messsages more specific, i.e. "Invalid time zone minutes digit" or
something.)
Thanks
--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
- Re: [PATCH v1] SRFI-19: Add support for ISO 8601 zones with a colon.,
Rob Browning <=