Best way to update parameter values in a temporary module

And here’s a version using eval to redefine a single function within the module:

julia> module MyModule
         x() = 1.0
         
         g(y) = y + x()
       end
Main.MyModule

julia> MyModule.g(1)
2.0

julia> @eval MyModule x() = 2.0
x (generic function with 1 method)

julia> MyModule.g(1)
3.0
1 Like