@head @module loader @title loader: Dynamic loading of Alore code (deprecated) @note This module is deprecated and will be removed in the future. The compiler module will replace it. @end
This module enables dynamic compilation of Alore source code files. Dynamically loaded source files must follow the same conventions as ordinary Alore programs. They may import any modules imported by the program that loads the file and additional modules, potentially located in different directories. @note It is not safe to load source code from untrusted sources. Malicious code may read or delete your personal data files. @end
By default, the constant @ref{ModuleSearchPath} specifies the module search path. The optional argument can be provided to override the default module search path. The format of the argument is the same as the format of the @ref{ModuleSearchPath} constant. @end
The Module class provides these members and operations:
@fun contents() as Array Dynamically loaded code may not compile new copies of any already imported
modules. Therefore
any global variables in modules are shared between all source files in a
program, and module initialization is performed only once per module.
As an exception to this rule, if only a dynamically loaded source file or
module refers to a module, and all references to code that may access this
module (including Module objects, function objects
and class instances)
are removed, the garbage collector of the Alore runtime may free and
destroy the module. In this case, a new copy of the module can be imported
later.
Exception CompileError
@class CompileError(errorMessages as ArrayCompileError members
@var errorMessages as ArrayShared modules and garbage collection