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: Nov 22 2024 at 04:41 UTC