From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Two r6rs bugs Date: Fri, 23 Nov 2012 01:29:17 -0500 Message-ID: <877gpc4yte.fsf@tines.lan> References: <873902x6v9.fsf@googlemail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1353652182 24717 80.91.229.3 (23 Nov 2012 06:29:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2012 06:29:42 +0000 (UTC) Cc: guile-devel@gnu.org To: Ian Price Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Nov 23 07:29:53 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tbmls-00046I-IN for guile-devel@m.gmane.org; Fri, 23 Nov 2012 07:29:52 +0100 Original-Received: from localhost ([::1]:43017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbmli-0000W4-09 for guile-devel@m.gmane.org; Fri, 23 Nov 2012 01:29:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbmlf-0000Vz-7v for guile-devel@gnu.org; Fri, 23 Nov 2012 01:29:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tbmlb-0003DY-Nu for guile-devel@gnu.org; Fri, 23 Nov 2012 01:29:39 -0500 Original-Received: from world.peace.net ([96.39.62.75]:52118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tbmlb-0003DN-Jz for guile-devel@gnu.org; Fri, 23 Nov 2012 01:29:35 -0500 Original-Received: from ip68-9-118-38.ri.ri.cox.net ([68.9.118.38] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TbmlS-0001LM-Oo; Fri, 23 Nov 2012 01:29:27 -0500 In-Reply-To: <873902x6v9.fsf@googlemail.com> (Ian Price's message of "Thu, 22 Nov 2012 10:35:38 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15237 Archived-At: Hi Ian, Ian Price writes: > The second one is a change to resolve-r6rs-interface. Previously > mark-weaver [0], changes this so that it would correctly look up > submodules under the srfi namespace, but in doing so took into account > the srfi 97[1] library name, which it should not have done. I have added a > comment to this effect in the source. Indeed, good catch! However, I'd prefer to fix this differently. See below. > From 3c73a30c89e005927dcd6239b54e752c05c2a48f Mon Sep 17 00:00:00 2001 > From: Ian Price > Date: Thu, 22 Nov 2012 10:16:44 +0000 > Subject: [PATCH 2/2] R6RS srfi library names should ignore first identifier > after the :n > > * module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface): > (srfi :n name ids ...) -> (srfi srfi-n ids ...) > * test-suite/tests/rnrs-libraries.test ("srfi"): Add test. > --- > module/ice-9/r6rs-libraries.scm | 6 +++++- > test-suite/tests/rnrs-libraries.test | 4 +++- > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/module/ice-9/r6rs-libraries.scm b/module/ice-9/r6rs-libraries.scm > index 019a6a7..9fef7a2 100644 > --- a/module/ice-9/r6rs-libraries.scm > +++ b/module/ice-9/r6rs-libraries.scm > @@ -40,7 +40,11 @@ > (substring (symbol->string (syntax->datum #'colon-n)) > 1))))) > (resolve-r6rs-interface > - #`(library (srfi #,srfi-n rest ... (version ...)))))) > + (if (null? #'(rest ...)) > + #`(library (srfi #,srfi-n (version ...))) > + ;; SRFI 97 says that the first identifier after the colon-n > + ;; is used for the libraries name, so it must be ignored. > + #`(library (srfi #,srfi-n #,@(cdr #'(rest ...)) (version ...))))))) Instead of using 'null?' and 'cdr' on the syntax object, can you please rework this to use 'syntax-case'? I.e. instead of (if (null? ...) ...) do this: (syntax-case #'(rest ...) () (() ) ((name rest ...) )) What do you think? Other than that, it looks good to me. Thanks, Mark