Guru's Verification engine ensures consistency, confidence, and trust in the knowledge your organization shares. Learn more.

Julia | Code loading (`include`, `using`, `import`)

Julia has several ways of loading code from other locations: include, using, and import [1]:

include("path/to/file.jl") # evaluates the expressions in the target file in the current contextusing some_package # adds all exported names in `some_package` to the current module's namespacesome_package_function_1() # all exported in `some_package` can now be used without prefixsome_package_function_2()using some_package: some_package_function_1 # adds the specific name in `some_package` to the current namespacesome_package_function_1() # all exported in `some_package` can now be used without prefixsome_package_function_2() # invalid, since this function wasn't included in the `using` statementimport some_package # adds `some_package` itself to the current namespace, but doesn't directly add its exportssome_package.some_package_function_1() # names inside the package can be called through the package namesome_package_function_1() # invalid, since we used `import` instead of `using`

Resources:

You must have Author or Collection Owner permission to create Guru Cards. Contact your team's Guru admins to use this template.