Extend julia module

It’s not clear what your use case is but one possible answer is that you can eval new things into an existing module.

julia> module Test
       f() = 1
       end
Main.Test

julia> @eval Test begin
       g() = 2
       end
g (generic function with 1 method)

julia> Test.f()
1

julia> Test.g()
2

4 Likes