Similar to python. One files containing everything; function, vars, etc for one type of entity.
Modules
and files <your file>.jl
are two SEPERATE things. Modules, is like classes without scopes or security. Here are the key points:
namespaces
. Key things seperate, to avoid conflicts.qualified name
.using
and import
.using
imports everything (data + functions) everything into current namespace and make the modules name as “qualified name” (something that can be used with “.” to access modules stuff.import
only imports whatever is mentioned in export
statement of module you are importing.using
and import
can be used with “as xyz”, which will make “xyz” as a qualified alias.From Here
include is used for including the content of a file into your current program. It has per se nothing to do with modules or namespaces. using and import on the other hand have nothing to do with files, and deal exclusively with modules/namespaces.
Julia Docs links:
module <mod_name>
#
# body
#
end
include("<mod_FILE_name>.jl")
# 2 different ways to use it
using .<mod_name>
include .<mod2_name>
<var> = <mod_name>.<whatever>
Additionally: using
includes export
related content of modules into current namespace; i.e no “.” required, just use that var or function natively. as if it were present in current file.