Modules and Loading through the Editor Interface

When you (re)load some Prolog code through the editor interface, the module into which the code is to be loaded is selected as follows.

Note that when a fragment of code has been loaded into a particular module other than user, the editor will subsequently insist that that code belongs to that module. In order to change this, the entire module must be reloaded.

When a module declaration is processed, the module is reinitialized; all predicates previously imported into that module are forgotten. Therefore, when only part of a module-file is reloaded through the editor interface, that part should generally not include the module declaration.

Loading an entire module through the editor interface is like loading the module via the Load Predicates in that all the public predicates in the module are imported into the type-in module. The only difference is that in the case in which you load the module through the editor interface you will be prompted for confirmation before the importation takes place. This is because there are situations in which you might want to reload a module via the editor interface without importing it into the type-in module; that is, situations in which you would not want to allow the importation to happen. For example, suppose that the type-in module is the default user, and that you have been modifying a module m1 from which another module m2 imports predicates, but from which user does not import anything. In this case, you may want to reload m1, using the editor interface, without importing it into user.

When a file that is not a module-file is loaded into several different modules, reloading all or part of it through the editor interface affects only the module into which it was most recently loaded.