From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH v1] SRFI-19: Add support for ISO 8601 zones with a colon. Date: Wed, 06 Mar 2024 12:42:10 -0600 Message-ID: <87r0gnjj7h.fsf@trouble.defaultvalue.org> References: <20240229212343.10442-1-GNUtoo@cyberdimension.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13769"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org To: Denis 'GNUtoo' Carikli Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Mar 06 19:42:34 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rhwDp-0003No-L8 for guile-devel@m.gmane-mx.org; Wed, 06 Mar 2024 19:42:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhwDd-0006fm-19; Wed, 06 Mar 2024 13:42:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhwDb-0006fZ-CJ for guile-devel@gnu.org; Wed, 06 Mar 2024 13:42:19 -0500 Original-Received: from defaultvalue.org ([45.33.119.55]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhwDV-0000As-1J for guile-devel@gnu.org; Wed, 06 Mar 2024 13:42:15 -0500 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 1C38420275; Wed, 6 Mar 2024 12:42:11 -0600 (CST) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id C5D0514E081; Wed, 6 Mar 2024 12:42:10 -0600 (CST) In-Reply-To: <20240229212343.10442-1-GNUtoo@cyberdimension.org> Received-SPF: pass client-ip=45.33.119.55; envelope-from=rlb@defaultvalue.org; helo=defaultvalue.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22340 Archived-At: Denis 'GNUtoo' Carikli 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