[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 02/10] Use R7RS 'rename' syntax for exports.
From: |
Maxim Cournoyer |
Subject: |
[PATCH v4 02/10] Use R7RS 'rename' syntax for exports. |
Date: |
Wed, 22 Nov 2023 22:25:13 -0500 |
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'.
Fixes: https://bugs.gnu.org/67255
Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>.
---
(no changes since v1)
module/ice-9/r7rs-libraries.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/module/ice-9/r7rs-libraries.scm b/module/ice-9/r7rs-libraries.scm
index 63a300a26..f8b6b4c59 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,17 @@
((decl ...)
(partition-decls #'(decl ... . decls) exports imports code))))))
+ (define (r7rs-export->r6rs-export export)
+ (syntax-case export (rename)
+ ((rename internal external) #'(rename (internal external)))
+ (_ export)))
+
(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
- [PATCH v4 00/10] Add a few new SRFIs, R7RS libraries, Maxim Cournoyer, 2023/11/22
- [PATCH v4 01/10] ice-9: Fix 'include' when used in compilation contexts., Maxim Cournoyer, 2023/11/22
- [PATCH v4 02/10] Use R7RS 'rename' syntax for exports.,
Maxim Cournoyer <=
- [PATCH v4 04/10] module: Add SRFI 126., Maxim Cournoyer, 2023/11/22
- [PATCH v4 07/10] module: Add (scheme sort)., Maxim Cournoyer, 2023/11/22
- [PATCH v4 06/10] module: Add (scheme comparator)., Maxim Cournoyer, 2023/11/22
- [PATCH v4 05/10] module: Add SRFI 128., Maxim Cournoyer, 2023/11/22
- [PATCH v4 03/10] build: Register '.sld' as an alternative extension to '.scm'., Maxim Cournoyer, 2023/11/22
- [PATCH v4 08/10] module: Add SRFI 125., Maxim Cournoyer, 2023/11/22
- [PATCH v4 09/10] module: Add SRFI 151., Maxim Cournoyer, 2023/11/22
- [PATCH v4 10/10] module: Add SRFI 160., Maxim Cournoyer, 2023/11/22