Custom `__ENV__`

Is there any way to custom __ENV__?
For example, how to make __ENV__.file return “I need a custom value” when I execute it within a file named “a.ex”.

Thank you

1 Like

Macro.Env documentation

An instance of Macro.Env must not be modified by hand.

But on the very same page there are some hints on how to get modified environments.

1 Like

Thank you.
But I didn’t use it for Code.eval_quoted.
Finally I do this by edit the AST.

1 Like