Is there a way to change the apparent module when evaling an expression? For Documenter we evaluate into anonymous modules, and then manually clean up stacktraces etc to make it look like it was evaluated in Main rather than Main.anon_mod. I want e.g.
anon_mod = Module(:anon_mod)
Core.eval(anon_mod, Meta.parse("print(@__MODULE__)"))
to print Main instead of Main.anon_mod.
Last updated: Nov 27 2025 at 04:44 UTC