From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] `import' should accept multiple clauses Date: Sun, 06 Jun 2010 16:22:33 +0200 Message-ID: <87bpbo44wm.fsf@delenn.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1275834199 10069 80.91.229.12 (6 Jun 2010 14:23:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Jun 2010 14:23:19 +0000 (UTC) To: Guile Development Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jun 06 16:23:18 2010 connect(): No such file or directory Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OLGkh-0008Cn-5d for guile-devel@m.gmane.org; Sun, 06 Jun 2010 16:23:17 +0200 Original-Received: from localhost ([127.0.0.1]:55806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLGkU-0007gw-8z for guile-devel@m.gmane.org; Sun, 06 Jun 2010 10:22:50 -0400 Original-Received: from [140.186.70.92] (port=41305 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLGkQ-0007gQ-0e for guile-devel@gnu.org; Sun, 06 Jun 2010 10:22:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLGkO-0005mu-Jx for guile-devel@gnu.org; Sun, 06 Jun 2010 10:22:45 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:49169) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OLGkO-0005md-63 for guile-devel@gnu.org; Sun, 06 Jun 2010 10:22:44 -0400 Original-Received: (qmail invoked by alias); 06 Jun 2010 14:22:41 -0000 Original-Received: from 83-215-154-5.hage.dyn.salzburg-online.at (EHLO nathot.lan) [83.215.154.5] by mail.gmx.net (mp021) with SMTP; 06 Jun 2010 16:22:41 +0200 X-Authenticated: #3102804 X-Provags-ID: V01U2FsdGVkX1/cMgwUhAHcCjCNh+CVHmniVgS/qumGTvDAz7vB+y in6IGmqQw4EWB4 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by nathot.lan (Postfix) with ESMTP id 87ABF3A6B1 for ; Sun, 6 Jun 2010 16:22:40 +0200 (CEST) Original-Received: from nathot.lan ([127.0.0.1]) by localhost (nathot.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cVTg6N6uFCaF for ; Sun, 6 Jun 2010 16:22:33 +0200 (CEST) Original-Received: from delenn.lan (delenn.lan [192.168.3.11]) by nathot.lan (Postfix) with ESMTP id DC79D3A6B0 for ; Sun, 6 Jun 2010 16:22:33 +0200 (CEST) Original-Received: by delenn.lan (Postfix, from userid 1000) id A5FFF74F00; Sun, 6 Jun 2010 16:22:33 +0200 (CEST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:10442 Archived-At: --=-=-= Hi! Currently, R6RS `import' only accepts a single library reference; for example `(import (rnrs base) (rnrs programs))' fails. The attached patch should fix this. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=+import-multiple.patch diff --git a/module/ice-9/r6rs-libraries.scm b/module/ice-9/r6rs-libraries.scm index 56d4300..482f826 100644 --- a/module/ice-9/r6rs-libraries.scm +++ b/module/ice-9/r6rs-libraries.scm @@ -190,13 +190,19 @@ (define-syntax import (lambda (stx) - (syntax-case stx (for) - ((_ (for import-set import-level ...)) - #'(import import-set)) - ((_ import-set) - #'(eval-when (eval load compile expand) - (let ((iface (resolve-r6rs-interface 'import-set))) - (call-with-deferred-observers - (lambda () - (module-use-interfaces! (current-module) (list iface)))) + (define (strip-for import-set) + (syntax-case import-set (for) + ((for import-set import-level ...) + #'import-set) + (import-set + #'import-set))) + (syntax-case stx () + ((_ import-set ...) + (with-syntax (((library-reference ...) (map strip-for #'(import-set ...)))) + #'(eval-when (eval load compile expand) + (let ((iface (resolve-r6rs-interface 'library-reference))) + (call-with-deferred-observers + (lambda () + (module-use-interfaces! (current-module) (list iface))))) + ... (if #f #f))))))) --=-=-= Regards, Rotty -- Andreas Rottmann -- --=-=-=--