From e048b3f7c5ded5449c7cc6b5b765a4bca030d369 Mon Sep 17 00:00:00 2001 From: Oscar Waddell Date: Wed, 4 Oct 2023 14:27:10 -0400 Subject: [PATCH] fix library-reference import syntax (#723) --- LOG | 4 ++++ mats/8.ms | 24 ++++++++++++++++++++++++ release_notes/release_notes.stex | 5 +++++ s/syntax.ss | 2 +- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/LOG b/LOG index 2e1ed95b6..69697c314 100644 --- a/LOG +++ b/LOG @@ -2429,3 +2429,7 @@ csug/csug.stex bintar/Makefile rpm/Makefile pkg/Makefile wininstall/Makefile wininstall/a6nt.wxs wininstall/i3nt.wxs wininstall/ta6nt.wxs wininstall/ti3nt.wxs + +9.6.3 changes: +- fix (library ) import syntax + mats/8.ms release_notes/release_notes.stex s/syntax.ss diff --git a/mats/8.ms b/mats/8.ms index 27ac137c4..2d978fccb 100644 --- a/mats/8.ms +++ b/mats/8.ms @@ -3417,6 +3417,30 @@ (import-only A B) x)) 'b) + (begin + (library (for mat) (export x) (import (scheme)) (define x 123)) + (library (a b c) (export d) (import (scheme)) (define d 27)) + (library (xd) + (export ls) + (import (scheme) (library (for mat)) (library (a b c))) + (define ls (list x d))) + #t) + (equal? 123 + (let ([x 'port]) + (import (library (for mat))) + x)) + (equal? 27 + (let ([d 'nile]) + (import (library (a b c))) + d)) + (equal? 27 + (let ([d 'nile]) + (import (a b c)) + d)) + (equal? '(123 27) + (let ([x 'treme] [d 'nile]) + (import (xd)) + ls)) ) (mat export ; test stand-alone export form diff --git a/release_notes/release_notes.stex b/release_notes/release_notes.stex index 1f5ac5675..b34b54b17 100644 --- a/release_notes/release_notes.stex +++ b/release_notes/release_notes.stex @@ -1966,6 +1966,11 @@ in fasl files does not generally make sense. %----------------------------------------------------------------------------- \section{Bug Fixes}\label{section:bugfixes} +\subsection{Library-reference import syntax} + +A bug where \scheme{import} did not recognize a \var{library-spec} +of the form \scheme{(library \var{library-reference})} has been fixed. + \subsection{Garbage collector incorrectly handles emphemerons (9.6.0)} A bug where the garbage collector sometimes incorrectly handles epehemeron pairs has diff --git a/s/syntax.ss b/s/syntax.ss index 6fc47759f..5a9ef63fb 100644 --- a/s/syntax.ss +++ b/s/syntax.ss @@ -4250,7 +4250,7 @@ (and (not std?) (id? #'mid)) (determine-module-imports "module" #'mid #'mid #'mid)] [(?library-reference lr) - (sym-kwd? ?library-reference library-reference) + (sym-kwd? ?library-reference library) (let-values ([(mid tid) (lookup-library #'lr)]) (determine-module-imports "library" #'lr mid tid))] [lr (let-values ([(mid tid) (lookup-library #'lr)])