From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.devel Subject: Re: Two r6rs bugs Date: Sun, 25 Nov 2012 12:30:29 +0000 Message-ID: <878v9pdfve.fsf@Kagami.home> References: <873902x6v9.fsf@googlemail.com> <877gpc4yte.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1353846642 3515 80.91.229.3 (25 Nov 2012 12:30:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Nov 2012 12:30:42 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Nov 25 13:30:54 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 1TcbML-0007ml-Gd for guile-devel@m.gmane.org; Sun, 25 Nov 2012 13:30:53 +0100 Original-Received: from localhost ([::1]:59240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcbMA-0003Vt-MR for guile-devel@m.gmane.org; Sun, 25 Nov 2012 07:30:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcbM7-0003Vd-11 for guile-devel@gnu.org; Sun, 25 Nov 2012 07:30:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TcbM5-0007Zv-L7 for guile-devel@gnu.org; Sun, 25 Nov 2012 07:30:38 -0500 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:32842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcbM5-0007Zr-EQ for guile-devel@gnu.org; Sun, 25 Nov 2012 07:30:37 -0500 Original-Received: by mail-we0-f169.google.com with SMTP id t49so2407798wey.0 for ; Sun, 25 Nov 2012 04:30:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=NK4zoQiRyQNu3jSY2rk1l9kun5uh8uW/OnV+wQyOuVY=; b=rfiVCiNsKLqc1CWJUOdiW+X0fbMZ6dHnwlZomGCO5gu/Rrzp0HmF9vDTs5dXnkY932 2MJBCT4aHwwkYlh49FZO8gha6DGte0hytReYaielgUCFxD+uBJw3h55qJdrSu9YnKTDN Fdu+r9h6QD4HOeOipk9RnzjPn280FAFLzn7JuSBOkSC1EK6FcdcEGPA6yy3DhpT+l2Gd Trm9I5bItjQyicyIftbsN8qlUiFVRxfxrsVWFXahjMnkbcSKoHfdlwwqEhotnAN3p+7U RNQAlbBupQDa9dvRNa/7qBmyZZeeezAlvZ0ejCmQFL7zRbwVtHWeZBun+xr3Ob8fS+UA ZRpA== Original-Received: by 10.180.92.132 with SMTP id cm4mr16571228wib.12.1353846636307; Sun, 25 Nov 2012 04:30:36 -0800 (PST) Original-Received: from Kagami.home (host86-182-157-241.range86-182.btcentralplus.com. [86.182.157.241]) by mx.google.com with ESMTPS id em6sm1773502wib.0.2012.11.25.04.30.33 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Nov 2012 04:30:34 -0800 (PST) In-Reply-To: <877gpc4yte.fsf@tines.lan> (Mark H. Weaver's message of "Fri, 23 Nov 2012 01:29:17 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.82.169 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:15247 Archived-At: --=-=-= Mark H Weaver writes: > 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? Yes, that would be much better. It's startling how often I forget I can syntax-case this way. Changed, okay for me to push? -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-R6RS-srfi-library-names-should-ignore-first-identifi.patch Content-Description: srfi :n patch >From 5d7c55bdcffbc326e775b0b9c881a01e44eee160 Mon Sep 17 00:00:00 2001 From: Ian Price Date: Sun, 25 Nov 2012 12:28:41 +0000 Subject: [PATCH] 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 | 8 +++++++- test-suite/tests/rnrs-libraries.test | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/module/ice-9/r6rs-libraries.scm b/module/ice-9/r6rs-libraries.scm index 019a6a7..428d951 100644 --- a/module/ice-9/r6rs-libraries.scm +++ b/module/ice-9/r6rs-libraries.scm @@ -40,7 +40,13 @@ (substring (symbol->string (syntax->datum #'colon-n)) 1))))) (resolve-r6rs-interface - #`(library (srfi #,srfi-n rest ... (version ...)))))) + (syntax-case #'(rest ...) () + (() + #`(library (srfi #,srfi-n (version ...)))) + ((name rest ...) + ;; 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 rest ... (version ...)))))))) ((library (name name* ... (version ...))) (and-map sym? #'(name name* ...)) diff --git a/test-suite/tests/rnrs-libraries.test b/test-suite/tests/rnrs-libraries.test index e961c28..9add98a 100644 --- a/test-suite/tests/rnrs-libraries.test +++ b/test-suite/tests/rnrs-libraries.test @@ -183,7 +183,9 @@ (with-test-prefix "srfi" (pass-if "renaming works" (eq? (resolve-interface '(srfi srfi-1)) - (resolve-r6rs-interface '(srfi :1))))) + (resolve-r6rs-interface '(srfi :1))) + (eq? (resolve-interface '(srfi srfi-1)) + (resolve-r6rs-interface '(srfi :1 lists))))) (with-test-prefix "macro" (pass-if "multiple clauses" -- 1.7.7.6 --=-=-=--