From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.lisp.guile.devel Subject: [PATCH v7 02/16] Use R7RS 'rename' syntax for exports. Date: Mon, 4 Dec 2023 16:45:07 -0500 Message-ID: <20231204215143.3146-3-maxim.cournoyer@gmail.com> References: <20231204215143.3146-1-maxim.cournoyer@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40785"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Timothy Sample , Maxim Cournoyer To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Dec 04 22:52:42 2023 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 1rAGrp-000ALz-Ul for guile-devel@m.gmane-mx.org; Mon, 04 Dec 2023 22:52:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAGr9-0000Aa-Og; Mon, 04 Dec 2023 16:51:59 -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 1rAGr7-00009h-Em for guile-devel@gnu.org; Mon, 04 Dec 2023 16:51:57 -0500 Original-Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAGr5-0007oU-P8 for guile-devel@gnu.org; Mon, 04 Dec 2023 16:51:57 -0500 Original-Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3b8903f7192so2642012b6e.0 for ; Mon, 04 Dec 2023 13:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701726714; x=1702331514; darn=gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/0FSsZF/uM6wQvIGAgJTj+XJSRr1nfMOWljcL1fywDY=; b=OkgO+Igi3nKhW+x7ZdjXZ3xI1bApmXWEswmeM4S9VXJWrMIaSHLaHdAJvi4yv1jX9b JZKJsSv0uDqqzMWF60+nS/Wfu7fA3QR16ismzLzgeOF+G9n4VAV5R7WPSfxQ0GzhElvB XWlqbUkNrjdwF3cERWSQZkcNQaAZ+rMDrYCAaURhVDcbd6qfyMqXK7s6C67sQEZdQnIs pK8875XbtyneVtLfvB5cSAtFj2J3sETbx4e04jQBmOxz+3wIYsyTVaBofADGDnpS+iXM RgH46g8C1jLF4NJ1rq+5TqiIeQGqxVUpliKnbKjQ8sq6KQu12gP4r9mVZyzDjaKulJcM DScg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701726714; x=1702331514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/0FSsZF/uM6wQvIGAgJTj+XJSRr1nfMOWljcL1fywDY=; b=KGnei9sXkwVoOCzxL1rFcCImLT5jMqOPE/4dyhkr0ukm7AqlqaTxggSfpBwXbysYiC 4iOSzVl36h43xC9sCXJl/BVO21ZusdeafgkiFvhRcpfVF2NIZcsyvLG6PKOnE5GsQtHv bna3aipPFB3E1EuMy2ZMbMjeiyGEaxGIuTZCEeN/TGxYCYpeuldEeqjQqwWpna55StQZ 6H/tkBU7mFl4yMXQGAFaNWsvpVK/uW5E8pnlKzIWI9vklAWOsXh3V0l6Qu/zHzJFibXk P1Dv0loh0ui/tk424Jj2K/ERI/f1rzgVthU3+TL4bTZofMxZOHpHb2U72MikRbJOAZDD V/dA== X-Gm-Message-State: AOJu0YyBtHDZDUwckOMo3CxVtzq5BlEzaBNJekRlxXwv+bjMzFY4j31n tkhShShGWfVSPMiPYbj/UP5YT/Pv8S0KOA== X-Google-Smtp-Source: AGHT+IH4ErlB0V8vPOwOf/9s5GgZi/NQ4jZ5nprZc1GAlgiz4PfFtKnaVJ08UzGL0xyNsB6zlyD9wQ== X-Received: by 2002:a05:6808:c8:b0:3b8:b063:6677 with SMTP id t8-20020a05680800c800b003b8b0636677mr4309577oic.110.1701726714042; Mon, 04 Dec 2023 13:51:54 -0800 (PST) Original-Received: from localhost.localdomain (dsl-141-198.b2b2c.ca. [66.158.141.198]) by smtp.gmail.com with ESMTPSA id jd24-20020a05622a719800b00425438e7c5esm2642503qtb.62.2023.12.04.13.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 13:51:53 -0800 (PST) X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231204215143.3146-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=maxim.cournoyer@gmail.com; helo=mail-oi1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:22184 Archived-At: From: Timothy Sample * module/ice-9/r7rs-libraries.scm (define-library): Convert R7RS exports to R6RS exports before passing them on to 'library'. * NEWS: Mention bug fix. Fixes: https://bugs.gnu.org/67255 Reported-by: Maxim Cournoyer . Modified-by: Maxim Cournoyer --- (no changes since v5) Changes in v5: - Update NEWS NEWS | 2 ++ module/ice-9/r7rs-libraries.scm | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 6676c5715..6284bb127 100644 --- a/NEWS +++ b/NEWS @@ -50,6 +50,8 @@ other operations, given the internal use of those functions. ** Fix 'include' not finding included files when byte compiling Guile () +** R7RS define-library now properly supports 'rename' declarations + () Changes in 3.0.9 (since 3.0.8) diff --git a/module/ice-9/r7rs-libraries.scm b/module/ice-9/r7rs-libraries.scm index 63a300a26..429d82ad9 100644 --- a/module/ice-9/r7rs-libraries.scm +++ b/module/ice-9/r7rs-libraries.scm @@ -1,5 +1,5 @@ ;; R7RS library support -;; Copyright (C) 2020, 2021 Free Software Foundation, Inc. +;; Copyright (C) 2020, 2021, 2023 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public @@ -97,12 +97,18 @@ ((decl ...) (partition-decls #'(decl ... . decls) exports imports code)))))) + (define (r7rs-export->r6rs-export export-spec) + (syntax-case export-spec (rename) + ((rename from-identifier to-identifier) + #'(rename (from-identifier to-identifier))) + (identifier #'identifier))) + (syntax-case stx () ((_ name decl ...) (call-with-values (lambda () (partition-decls #'(decl ...) '() '() '())) (lambda (exports imports code) #`(library name - (export . #,exports) + (export . #,(map r7rs-export->r6rs-export exports)) (import . #,imports) . #,code))))))) -- 2.41.0