From: Rob Browning <rlb@defaultvalue.org>
To: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH v1] SRFI-19: Add support for ISO 8601 zones with a colon.
Date: Wed, 06 Mar 2024 12:42:10 -0600 [thread overview]
Message-ID: <87r0gnjj7h.fsf@trouble.defaultvalue.org> (raw)
In-Reply-To: <20240229212343.10442-1-GNUtoo@cyberdimension.org>
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
next prev parent reply other threads:[~2024-03-06 18:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 21:23 [PATCH v1] SRFI-19: Add support for ISO 8601 zones with a colon Denis 'GNUtoo' Carikli
2024-03-06 18:42 ` Rob Browning [this message]
2024-03-06 18:58 ` Rob Browning
2024-03-11 18:25 ` Denis 'GNUtoo' Carikli
2024-03-19 14:26 ` Denis 'GNUtoo' Carikli
2024-03-19 20:18 ` [PATCH v2] " Denis 'GNUtoo' Carikli
2024-03-20 0:21 ` [PATCH v1] " Rob Browning
2024-04-05 22:03 ` Rob Browning
2024-04-12 15:19 ` Denis 'GNUtoo' Carikli
2024-04-13 19:44 ` Rob Browning
2024-04-12 15:19 ` Denis 'GNUtoo' Carikli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r0gnjj7h.fsf@trouble.defaultvalue.org \
--to=rlb@defaultvalue.org \
--cc=GNUtoo@cyberdimension.org \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).