diff options
author | Julian Graham <julian.graham@aya.yale.edu> | 2010-05-27 21:32:20 -0400 |
---|---|---|
committer | Julian Graham <julian.graham@aya.yale.edu> | 2010-05-27 21:32:39 -0400 |
commit | 04186f2006bba79ffd7097f3664919078dc4d656 (patch) | |
tree | b3cbe4e35e4cbad18548688b76b0114e012c02e1 | |
parent | 853cb35661cb5ff9ef31595ea8189aa4b68ae4b4 (diff) | |
download | guile-04186f2006bba79ffd7097f3664919078dc4d656.tar.gz |
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.
-rw-r--r-- | module/ice-9/r6rs-libraries.scm | 10 | ||||
-rw-r--r-- | test-suite/tests/rnrs-libraries.test | 15 |
2 files changed, 23 insertions, 2 deletions
diff --git a/module/ice-9/r6rs-libraries.scm b/module/ice-9/r6rs-libraries.scm index fbe80edf9..56d430025 100644 --- a/module/ice-9/r6rs-libraries.scm +++ b/module/ice-9/r6rs-libraries.scm @@ -161,8 +161,14 @@ (and-map identifier? #'(name name* ...)) (call-with-values (lambda () - (compute-exports (map resolve-r6rs-interface #'(ispec ...)) - #'(espec ...))) + (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 ...))) (lambda (exports re-exports) (with-syntax (((e ...) exports) ((r ...) re-exports)) diff --git a/test-suite/tests/rnrs-libraries.test b/test-suite/tests/rnrs-libraries.test index 9f6f6c1a8..4396c6769 100644 --- a/test-suite/tests/rnrs-libraries.test +++ b/test-suite/tests/rnrs-libraries.test @@ -114,6 +114,21 @@ (equal? (eval '(double 20) (current-module)) 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. ;; |