mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
Ignore explicit phase specification for imports in `library' form.
* module/ice-9/r6rs-libraries.scm (library): Unwrap the `for' sub-form during export resolution the same way that `import' does. * test-suite/tests/rnrs-libraries.test ("implicit phasing"): New test prefix and tests.
This commit is contained in:
parent
853cb35661
commit
04186f2006
2 changed files with 23 additions and 2 deletions
|
@ -161,7 +161,13 @@
|
||||||
(and-map identifier? #'(name name* ...))
|
(and-map identifier? #'(name name* ...))
|
||||||
(call-with-values
|
(call-with-values
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(compute-exports (map resolve-r6rs-interface #'(ispec ...))
|
(compute-exports
|
||||||
|
(map (lambda (im)
|
||||||
|
(syntax-case im (for)
|
||||||
|
((for import-set import-level ...)
|
||||||
|
(resolve-r6rs-interface #'import-set))
|
||||||
|
(import-set (resolve-r6rs-interface #'import-set))))
|
||||||
|
#'(ispec ...))
|
||||||
#'(espec ...)))
|
#'(espec ...)))
|
||||||
(lambda (exports re-exports)
|
(lambda (exports re-exports)
|
||||||
(with-syntax (((e ...) exports)
|
(with-syntax (((e ...) exports)
|
||||||
|
|
|
@ -114,6 +114,21 @@
|
||||||
(equal? (eval '(double 20) (current-module))
|
(equal? (eval '(double 20) (current-module))
|
||||||
40)))
|
40)))
|
||||||
|
|
||||||
|
;; Guile should ignore explicit phase specifications
|
||||||
|
;;
|
||||||
|
(with-test-prefix "implicit phasing"
|
||||||
|
(with-test-prefix "in library form"
|
||||||
|
(pass-if "explicit phasing ignored"
|
||||||
|
(import (for (guile) (meta -1))) #t))
|
||||||
|
|
||||||
|
(with-test-prefix "in library form"
|
||||||
|
(pass-if "explicit phasing ignored"
|
||||||
|
(save-module-excursion
|
||||||
|
(lambda ()
|
||||||
|
(library (test)
|
||||||
|
(export)
|
||||||
|
(import (for (guile) (meta -1))))
|
||||||
|
#t)))))
|
||||||
|
|
||||||
;; Now import features.
|
;; Now import features.
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue