Modules in Julia

Modules vs Packages Modules are used to group multiple functions and definitions together. Packages group multiple modules together with various metadata. Create a custom module Open up a new .jl file to create your own module. Here I named the file “testModule.jl”. In the file, one can group functions and/or other definitions together. Two functions are grouped by the module myModule. Only myfunction is exported. module myModule export myfunction function myfunction() println("Hello, friend") end function mysecretfunction() println("Hello, secret friend") end end Load modules To load modules, use either using or import....

April 1, 2023 · 1 min · 154 words · Me