From: Chris Hanson Date: Mon, 18 Nov 2019 00:14:20 +0000 (-0800) Subject: Fix warning about re-exporting imported names from libraries. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~10 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d761d720a5200514b56481b8dcb8b5c289c4713e;p=mit-scheme.git Fix warning about re-exporting imported names from libraries. --- diff --git a/src/runtime/library-loader.scm b/src/runtime/library-loader.scm index 176a0ad42..ce9052d94 100644 --- a/src/runtime/library-loader.scm +++ b/src/runtime/library-loader.scm @@ -41,16 +41,15 @@ USA. (lambda (contents imports exports env) (receive (body bound free) (syntax-library-forms (expand-contents contents) env) - (let ((exports-from (map library-export-from exports))) - (if (not (lset<= eq? exports-from (lset-union eq? bound free))) - (warn "Library export refers to unbound identifiers:" - (lset-difference eq? - exports-from - (lset-union eq? bound free))))) (let ((imports-to (map library-import-to imports))) (if (not (lset<= eq? free imports-to)) (warn "Library has free references not provided by imports:" - (lset-difference eq? free imports-to)))) + (lset-difference eq? free imports-to))) + (let ((exports-from (map library-export-from exports)) + (bound* (lset-union eq? bound imports-to))) + (if (not (lset<= eq? exports-from bound*)) + (warn "Library export refers to unbound identifiers:" + (lset-difference eq? exports-from bound*))))) (values body (filter (lambda (import) (memq (library-import-to import) free))