submodules: make .zo path stick for consistent independent loading

When a module is loaded from bytecode and then the value of
`use-compiled-file-paths' changes, an attempt to load a submodule
would fail, because source isn't used if the main module is
already declared, and the bytecode code is not used according to
`use-compiled-file-paths'. Make the bytecode path stick when it
is used once, so that submodule loads succeed, and make it work
even with `namespace-module-attach'.

The module-attach part of this protocol requires a change to the
API of a module name resolver: the notification mode gets two
arguments, instead of one, where the second argument is an
environment.

original commit: c8f4ac6ae47023157a337aa5e164b74439e373d6
This commit is contained in:
Matthew Flatt 2012-07-17 08:49:53 -06:00
parent be30f1ae76
commit f549a9e634

View File

@ -1828,13 +1828,13 @@
[resolved-module-path-name (-> -Resolved-Module-Path (Un -Path -Symbol))]
[module-path? (asym-pred Univ B (-FS (-filter -Module-Path 0) -top))]
[current-module-name-resolver (-Param (cl->* (-Resolved-Module-Path . -> . Univ)
[current-module-name-resolver (-Param (cl->* (-Resolved-Module-Path Univ . -> . Univ)
((Un -Module-Path -Path)
(-opt -Resolved-Module-Path)
(-opt (-Syntax Univ))
-Boolean
. -> . -Resolved-Module-Path))
(cl->* (-Resolved-Module-Path . -> . Univ)
(cl->* (-Resolved-Module-Path Univ . -> . Univ)
((Un -Module-Path -Path)
(-opt -Resolved-Module-Path)
(-opt (-Syntax Univ))