require
require(module::Symbol)
This function is part of the implementation of using
/ import
, if a module is not already defined in Main
. It can also be called directly to force reloading a module, regardless of whether it has been loaded before (for example, when interactively developing libraries).
Loads a source files, in the context of the Main
module, on every active node, searching standard locations for files. require
is considered a top-level operation, so it sets the current include
path but does not use it to search for files (see help for include
). This function is typically used to load library code, and is implicitly called by using
to load packages.
When searching for files, require
first looks in the current working directory, then looks for package code under Pkg.dir()
, then tries paths in the global array LOAD_PATH
.
Examples
See Also
assert, backtrace, code_llvm, code_lowered, code_native, code_typed, code_warntype, :@which, compilecache, current_module, eval, finalize, finalizer, fullname, function_module, function_name, include_dependency, InterruptException, invoke, isconst, isdefined, isgeneric, methodswith, method_exists, module_name, module_parent, require, subtypes, unsafe_load, workspace, __precompile__,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.