From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: guile-devel@gnu.org
Cc: Timothy Sample <samplet@ngyro.com>,
Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [PATCH v5 02/15] Use R7RS 'rename' syntax for exports.
Date: Wed, 29 Nov 2023 16:59:30 -0500 [thread overview]
Message-ID: <20231129220225.6819-3-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20231129220225.6819-1-maxim.cournoyer@gmail.com>
From: Timothy Sample <samplet@ngyro.com>
* 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 <maxim.cournoyer@gmail.com>.
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
---
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
(<https://bugs.gnu.org/66046>)
+** R7RS define-library now properly supports 'rename' declarations
+ (<https://bugs.gnu.org/67255>)
\f
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
next prev parent reply other threads:[~2023-11-29 21:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 21:59 [PATCH v5 00/15] Add a few new SRFIs, R7RS libraries Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 01/15] ice-9: Fix 'include' when used in compilation contexts Maxim Cournoyer
2023-11-29 21:59 ` Maxim Cournoyer [this message]
2023-11-29 21:59 ` [PATCH v5 03/15] r7rs-libraries: Add support for 'else' clause in cond-expand Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 04/15] r7rs-libraries: Better support R7RS SRFI library names Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 05/15] (scheme base): Support non-negative SRFI integer names in cond-expand Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 06/15] Share features tested by cond-expand library declarations and expressions Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 07/15] build: Register '.sld' as an alternative extension to '.scm' Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 08/15] module: Add SRFI 126 Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 09/15] module: Add SRFI 128 Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 10/15] module: Add (scheme comparator) Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 11/15] module: Add (scheme sort) Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 12/15] module: Add SRFI 125 Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 13/15] module: Add SRFI 151 Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 14/15] module: Add SRFI 160 Maxim Cournoyer
2023-11-29 21:59 ` [PATCH v5 15/15] module: Add SRFI 178 Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231129220225.6819-3-maxim.cournoyer@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=guile-devel@gnu.org \
--cc=samplet@ngyro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).