mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
Allow fresh modules to be passed to `compile'.
* module/ice-9/boot-9.scm (module-name): When making MOD non-anonymous, bind it in the `(%app modules)' name space. * test-suite/tests/compiler.test ("psyntax")["compile in current module", "compile in fresh module"]: New tests. * test-suite/tests/modules.test ("foundations")["modules don't remain anonymous"]: New test.
This commit is contained in:
parent
b9434165b6
commit
16f451f308
3 changed files with 34 additions and 6 deletions
|
@ -1982,8 +1982,13 @@
|
|||
(let ((accessor (record-accessor module-type 'name)))
|
||||
(lambda (mod)
|
||||
(or (accessor mod)
|
||||
(begin
|
||||
(set-module-name! mod (list (gensym)))
|
||||
(let ((name (list (gensym))))
|
||||
;; Name MOD and bind it in THE-ROOT-MODULE so that it's visible
|
||||
;; to `resolve-module'. This is important as `psyntax' stores
|
||||
;; module names and relies on being able to `resolve-module'
|
||||
;; them.
|
||||
(set-module-name! mod name)
|
||||
(nested-define! the-root-module `(%app modules ,@name) mod)
|
||||
(accessor mod))))))
|
||||
|
||||
;; (define-special-value '(%app modules new-ws) (lambda () (make-scm-module)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue