This is just a vague idea. Suppose that LoadPackage("new"); fails. If appropriate, LoadPackage could mention things such as...
- If
PackageManager knows about the package new, but no version of new seems to be installed, it could offer to install new.
- If
new is present but not compiled, it could offer to compile the package.
- If it fails because of a package that it depends on, it could offer to install/update/compile that dependency.
I'm not sure about the feasibility of any of this! Just thought I'd record my ideas here.