Is there a way to change the apparent module when eval
ing 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: Dec 28 2024 at 04:38 UTC