How to replace current module from itself?

Hello, how to replace current module from itself? It is possible? Need use module REPL or enough macro?

julia> module RootModule

           function create_or_replace_slave_module()
               @eval(RootModule, module SlaveModule
                                   import ..RootModule
                                   replace_this_module() = RootModule.create_or_replace_slave_module()
                                   end)
               return nothing
           end
       end
Main.RootModule

julia> RootModule.create_or_replace_slave_module()

julia> RootModule.SlaveModule.replace_this_module()
WARNING: replacing module SlaveModule.

julia>