diff --git a/LOG b/LOG index 206a7031ce..d5f7e40a72 100644 --- a/LOG +++ b/LOG @@ -897,3 +897,5 @@ schlib.c - install equates.h, kernel.o, and main.o on unix-like systems Mf-install.in +- standalone export form now handles (import import-spec ...) + 8.ms, syntax.ss, release_notes.stex diff --git a/mats/8.ms b/mats/8.ms index 20efa5c3d8..33e183fdc3 100644 --- a/mats/8.ms +++ b/mats/8.ms @@ -7976,6 +7976,19 @@ (equal? (let () (import ($l3)) (f (f 3))) 3) + (begin + ;; (export import-spec ...) empty case + (library ($empty) (export) (import (chezscheme)) (export (import))) + #t) + (begin + (library ($l4-A) (export a) (import (chezscheme)) (define a 1)) + (library ($l4-B) (export b) (import (chezscheme)) (define b 2)) + #t) + (equal? '(1 2) (let () (import ($l4-A) ($l4-B)) (list a b))) + (begin + ;; (export import-spec ...) multiple imports case + (library ($l4-C) (export) (import (chezscheme)) (export (import ($l4-A) ($l4-B)))) + (equal? '(1 2) (let () (import ($l4-C)) (list a b)))) ) (mat library2 diff --git a/release_notes/release_notes.stex b/release_notes/release_notes.stex index c0678c7a0b..278017dc88 100644 --- a/release_notes/release_notes.stex +++ b/release_notes/release_notes.stex @@ -1554,6 +1554,12 @@ in fasl files does not generally make sense. %----------------------------------------------------------------------------- \section{Bug Fixes}\label{section:bugfixes} +\subsection{Incomplete handling of import specs within standalone export forms} + +A bug that limited the \scheme{(import \var{import-spec} \dots)} form within a +standalone \scheme{export} form to \scheme{(import \var{import-spec})} has been +fixed. + \subsection{Permission denied after deleting files or directories in Windows} In Windows, deleting a file or directory briefly leaves the file or diff --git a/s/syntax.ss b/s/syntax.ss index 574aead35a..f6c66ea197 100644 --- a/s/syntax.ss +++ b/s/syntax.ss @@ -4280,14 +4280,18 @@ (append #'(old-id ...) exports) (append #'(old-id ...) exports-to-check) (fold-right resolve&add-id new-exports #'(old-id ...) #'(new-id ...)))] - [(?import impspec) + [(?import impspec ...) (sym-kwd? ?import import) - (let-values ([(mid tid imps) (help-determine-imports #'impspec r #f)]) - (let ([imps (if (import-interface? imps) (module-exports imps) imps)]) - (values - (append (map car imps) exports) - exports-to-check - (fold-right add-id new-exports (map cdr imps)))))] + (let process-impspecs ([impspec* #'(impspec ...)]) + (if (null? impspec*) + (values exports exports-to-check new-exports) + (let-values ([(_mid _tid imps) (help-determine-imports (car impspec*) r #f)] + [(exports exports-to-check new-exports) (process-impspecs (cdr impspec*))]) + (let ([imps (if (import-interface? imps) (module-exports imps) imps)]) + (values + (append (map car imps) exports) + exports-to-check + (fold-right add-id new-exports (map cdr imps)))))))] [_ (syntax-error x "invalid export spec")])))))]) (g (cdr expspec**) exports exports-to-check new-exports)))))) )