Add a function fn(name: &str) -> Option<Module> to lovm2 that is dispatched whenever the interpreter needs to lookup modules for the Load instruction.
If the user commits to utilizing this feature, do this lookup first
If the lookup leads to a None value, continue with regular load path search
This functionality is needed because pylovm2 can generate modules from python code, but importing them into the vm is not suitable as it would require two mutable references to the vm itself. The new method narrows the mutation down to one reference only.
Add a function
fn(name: &str) -> Option<Module>
to lovm2 that is dispatched whenever the interpreter needs to lookup modules for theLoad
instruction.None
value, continue with regular load path search