6.13 Dynamic Modules
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Modules
        • Dynamic Modules
          • abolish_module/1
    • Packages
Availability:built-in
Source[det]abolish_module(+Module)
Reset Module to a new, empty module. All predicates of Module are abolished and their clauses are reclaimed by clause garbage collection (see garbage_collect_clauses/0). Exports and local operators are removed, the import module is reset to user and the module class and flags are reset to their defaults. If Module was loaded from a file, this file is unloaded (see unload_file/1). Predicates imported from Module into other modules become undefined.

The module itself remains as an empty module, so clauses that call predicates of Module keep working if these predicates are defined again. If nothing refers to the module and the flag gc_code is module, it is subsequently removed by garbage collection as described above. This predicate is safe to use while other threads are running code of Module. Succeeds silently if Module does not exist and raises a permission error for the modules user and system and other system modules.